An HTML Form has a drop-down list in which the options are listed by retrieving records from a backend (for which I am using ASP). The options in the drop-down list are displayed as
LastName FirstName (e-mail address)
The value of each option is a whole number. This HTML Form also includes a textbox. What I want is when a user chooses one of the options from the drop-down list, the e-mail address of that chosen option should be populated in the textbox. If the user selects another option then the e-mail address of this 2nd option selected should be populated in the textbox. But note that the e-mail address of the 1st option should be kept as it is in the textbox; the e-mail address of the 2nd option selected should just get appended to the textbox (after the e-mail address of the 1st option selected) & the 2 e-mail addresses should be seperated by a semi-colon (. Here's an example:
Suppose a user selects the option Bond James
from the drop-down list. The value of the textbox should be
Next the user selects another option Horne Matt
from the drop-down list. Now the value of the textbox should change to
The user selects yet another option Grant Hugh
as the 3rd option from the drop-down, then the value of the textbox should now change to
In short, the e-mail addresses should be delimited using a semi-colon ( when there are more than 1 e-mail address in the textbox. How do I do this using JavaScript?
Thanks,
Arpan
LastName FirstName (e-mail address)
The value of each option is a whole number. This HTML Form also includes a textbox. What I want is when a user chooses one of the options from the drop-down list, the e-mail address of that chosen option should be populated in the textbox. If the user selects another option then the e-mail address of this 2nd option selected should be populated in the textbox. But note that the e-mail address of the 1st option should be kept as it is in the textbox; the e-mail address of the 2nd option selected should just get appended to the textbox (after the e-mail address of the 1st option selected) & the 2 e-mail addresses should be seperated by a semi-colon (. Here's an example:
Suppose a user selects the option Bond James
Code:
(james@bond.com)
Code:
james@bond.com
Next the user selects another option Horne Matt
Code:
(matt@horne.com)
Code:
james@bond.com; matt@horne.com
The user selects yet another option Grant Hugh
Code:
(hugh@grant.com)
Code:
james@bond.com; matt@horne.com; hugh@grant.com
In short, the e-mail addresses should be delimited using a semi-colon ( when there are more than 1 e-mail address in the textbox. How do I do this using JavaScript?
Thanks,
Arpan