W
Wayne Cressman
I'm writing a function to dynamically change a form validation script
depending upon the user's choices.
The form onsubmit is:
onsubmit="writevalidate(this.select.value);return document.MM_returnValue"
I then have the following function
function writevalidate(selectvalue) {
var1 = "\'form1\',\'type\',\'#q\',\'0\',\'Please enter your
Type.\',\'select\',\'#q\',\'1\',\'Please select your Status.\'";
if (selectvalue=='Person')
{
YY_checkform('form1','type','#q','0','Please enter your
Type.','name','#q','0','Please enter your
name','select','#q','1','Please select your Status.');
}
else
{
YY_checkform(var1);
}
}
I'd like to be able to dynamically write my form parameters into the
variable var1 and then insert them into the function like so.
var1 = "\'form1\',\'type\',\'#q\',\'0\',\'Please enter your
Type.\',\'select\',\'#q\',\'1\',\'Please select your Status.\'";
YY_checkform(var1);
But currently it doesn't work.
How do I do this?
Thanks,
Wayne C.
depending upon the user's choices.
The form onsubmit is:
onsubmit="writevalidate(this.select.value);return document.MM_returnValue"
I then have the following function
function writevalidate(selectvalue) {
var1 = "\'form1\',\'type\',\'#q\',\'0\',\'Please enter your
Type.\',\'select\',\'#q\',\'1\',\'Please select your Status.\'";
if (selectvalue=='Person')
{
YY_checkform('form1','type','#q','0','Please enter your
Type.','name','#q','0','Please enter your
name','select','#q','1','Please select your Status.');
}
else
{
YY_checkform(var1);
}
}
I'd like to be able to dynamically write my form parameters into the
variable var1 and then insert them into the function like so.
var1 = "\'form1\',\'type\',\'#q\',\'0\',\'Please enter your
Type.\',\'select\',\'#q\',\'1\',\'Please select your Status.\'";
YY_checkform(var1);
But currently it doesn't work.
How do I do this?
Thanks,
Wayne C.