It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming JavaScript Forum

can i accomplish this with javascript?

can i accomplish this with javascript?

Postby javajack007 on Thu Jan 24, 2008 10:19 am

hello everyone..

i have a web form..here i want a textarea with add button next to it.

so when user clicks on add button. i want a box to appear. in this box user

can put his email address and when presses ok, the email should be auto

matically entered in the textarea.similarly he can add as many email address

as he wish in this way..can this be accomplished through javascript?

can anyone help me here..

thanks..
javajack007
 
Posts: 0
Joined: Thu Jan 24, 2008 9:43 am

Postby leonard on Thu Jan 24, 2008 1:23 pm

yes, you can do that with javascript, although i dont see the sense in a popup containing a textfield which puts the data into a textarea (why not wirte in the textarea directly?).

Use these elements:
Code: Select all
// to show/hide your popup (HTML-layer):
document.getElementById(myLayerID).style.visibility = 'visible';
document.getElementById(myLayerID).style.visibility = 'hidden';

// to get the value of the textfield;
myEmailAddress = document.myForm.myTextField.value;

// to append the value to the textarea:
document.getElementById(myTextAreaID).innerHTML += '<br/>'+ myEmailAddress;

.. no guarantee the code works.. I didn't have time to test.

cheers!
- leonard
:%s/^M//
There are 10 kinds of people:
Those who understand binary and those who don't.
User avatar
leonard
100+ Club
 
Posts: 147
Joined: Tue Dec 18, 2007 7:11 am
Location: Switzerland


Who is online

Users browsing this forum: No registered users and 6 guests