I use a simple form that is on an HTML page that also has some JavaScript functions on it. On the (method=post) form, I use
onSubmit=”return validate()” to validate the user-entered email address. I also use the following action parameter: action=”cfa.asp?todo=1&foundyact=strval.asp&foundnact=strsign.asp&emailad=”>
However, my validation function changes my “action” by appending the entered email address to the initial “action” value so that by the time the subsequent page gets invoked, I have the query string information that I need in place.
The problem is that this all works fine in IE but not in Mozilla FireFox. Can you help to figure that out?
Another interesting fact is that when I run in Mozilla FireFox, it seems to me that the entire “validate” function is not being invoked (because even when I enter an improperly formatted email address I do not get any alert messages… I instead go straight to the CFA page…)
Thank you in advance.
Here is my validate function……
function validate() {
if (! isValidEmail(document.forms[0].frmFrom.value)) {
document.forms[0].hiddenfield.value = “BAD”;
alert(“Please enter a valid email address”);
return false;
}
var action = document.getElementById(“formxd”).action;
var newaction = action + document.forms[0].frmFrom.value;
document.getElementById(“formxd”).action = newaction;
document.getElementById(“formxd”).submit();
document.forms[0].hiddenfield.value = “GOOD”;
alert(“Okay – I’ll look up the info…”);
return true;
}