P
pbd22
Hi All.
I am having problems:
1) adding an email to a list, creating a long list box of email
addresses.
2) sending all the email addresses to the server on form submit.
The current problem is that:
1) The input field does not display the added email addresses
(I am currently getting "options.length" is not an object").
2) when i submit the form (with test values) the email addresses
from the list box never appear on the server via Request.Form
Here is my code for adding an email.
function AddSomething() {
var inputvalue = document.getElementById('visitor').value;
var formObject = document.getElementById('invitepresenters');
addOption(formObject,inputvalue,inputvalue);
document.getElementById('visitor').value = "";
}
function addOption(selectObject,optionText,optionValue)
{
var optionObject = new Option(optionText,optionValue)
var optionRank = selectObject.options.length
selectObject.options[optionRank]=optionObject
}
And The HTML:
<input class="input_small" type="text" name="visitor" id="visitor"
value="<%=Request.Form("visitor")%>" />
<input type="button" value="Add" style="position: relative; margin-
top: 6px; display: inline;
padding-bottom: 3px; padding-top: 3px; line-height: 14px;"
onclick="AddSomething();" />
<select class="select_medium" name="visitors" size="7"
multiple="multiple">
</select>
<textarea class="text_xlarge" rows="5" cols="80"
name="invitepresenters" id="invitepresenters" style="margin-bottom:
10px" >
I Would Like the Email To Appear As Such In The Select Box:
<option value="(e-mail address removed)">[email protected]</option>
I appreciate your help.
Peter
I am having problems:
1) adding an email to a list, creating a long list box of email
addresses.
2) sending all the email addresses to the server on form submit.
The current problem is that:
1) The input field does not display the added email addresses
(I am currently getting "options.length" is not an object").
2) when i submit the form (with test values) the email addresses
from the list box never appear on the server via Request.Form
Here is my code for adding an email.
function AddSomething() {
var inputvalue = document.getElementById('visitor').value;
var formObject = document.getElementById('invitepresenters');
addOption(formObject,inputvalue,inputvalue);
document.getElementById('visitor').value = "";
}
function addOption(selectObject,optionText,optionValue)
{
var optionObject = new Option(optionText,optionValue)
var optionRank = selectObject.options.length
selectObject.options[optionRank]=optionObject
}
And The HTML:
<input class="input_small" type="text" name="visitor" id="visitor"
value="<%=Request.Form("visitor")%>" />
<input type="button" value="Add" style="position: relative; margin-
top: 6px; display: inline;
padding-bottom: 3px; padding-top: 3px; line-height: 14px;"
onclick="AddSomething();" />
<select class="select_medium" name="visitors" size="7"
multiple="multiple">
</select>
<textarea class="text_xlarge" rows="5" cols="80"
name="invitepresenters" id="invitepresenters" style="margin-bottom:
10px" >
I Would Like the Email To Appear As Such In The Select Box:
<option value="(e-mail address removed)">[email protected]</option>
I appreciate your help.
Peter