P
pbd22
Is there any reason why the below function wouldn't
allow the server to "Request.Form("visitors")?
The form just starts with this:
<select class="select_medium" name="visitors" id="visitors" size="7"></
select>
And the testAdd() function adds email addresses to the select.
Then i submit the form but the "visitors" element is never one of the
keys
(yes, it is inside the form tag).
Any ideas???
Thanks
function testAdd() {
try
{
var inputvalue = document.getElementById('visitor').value;
var formObject = document.getElementById('visitors');
var pattern=/^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+
([a-zA-Z])+/;
var goodemail;
var err = "";
if(pattern.test(inputvalue)){
goodemail = true;
}else{
if (inputvalue == "")
alert("You must type in an email address");
else
{
alert("Bad email address syntax.\n Check for format
errors.");
goodemail = false;
}
}
if (goodemail == true)
{
if (inputvalue.indexOf("vodafone") != -1)
{
addOption(formObject,inputvalue,inputvalue);
document.getElementById('visitor').value = "";
} else
{
alert("You can only send to other vodafone
employees");
}
}
}catch(e){alert(e.message);}
}
allow the server to "Request.Form("visitors")?
The form just starts with this:
<select class="select_medium" name="visitors" id="visitors" size="7"></
select>
And the testAdd() function adds email addresses to the select.
Then i submit the form but the "visitors" element is never one of the
keys
(yes, it is inside the form tag).
Any ideas???
Thanks
function testAdd() {
try
{
var inputvalue = document.getElementById('visitor').value;
var formObject = document.getElementById('visitors');
var pattern=/^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+
([a-zA-Z])+/;
var goodemail;
var err = "";
if(pattern.test(inputvalue)){
goodemail = true;
}else{
if (inputvalue == "")
alert("You must type in an email address");
else
{
alert("Bad email address syntax.\n Check for format
errors.");
goodemail = false;
}
}
if (goodemail == true)
{
if (inputvalue.indexOf("vodafone") != -1)
{
addOption(formObject,inputvalue,inputvalue);
document.getElementById('visitor').value = "";
} else
{
alert("You can only send to other vodafone
employees");
}
}
}catch(e){alert(e.message);}
}