mango
08-05-2005, 09:48 AM
cannot get the following form validation to work, any ideas:
the top of the form is:
<form action="index.cfm" method="post" id="marketingprFormedit" name="emailsig_form" onsubmit="return chkemailsignature();">
javascript is
function chkemailsignature() {
thisForm = document.getElementById("marketingprFormedit");
var errorinfo = "";
var retval = true;
if (thisForm.html_sig.value == 0 && !thisForm.html_sig.value.length) {
retval = false;
errorinfo += "\n * Please complete the html E-mail signature in the upper edit field.\n";
}
if (thisForm.text_sig.value == 0 && !thisForm.text_sig.value.length) {
retval = false;
errorinfo += "\n * Please complete the text E-mail signature in the lower edit field.\n";
}
if (thisForm.title.value == 0 && !thisForm.title.value.length) {
retval = false;
errorinfo += "\n * Please give this E-mail signature a title.\n";
}
return retval;
}
many thanks
the top of the form is:
<form action="index.cfm" method="post" id="marketingprFormedit" name="emailsig_form" onsubmit="return chkemailsignature();">
javascript is
function chkemailsignature() {
thisForm = document.getElementById("marketingprFormedit");
var errorinfo = "";
var retval = true;
if (thisForm.html_sig.value == 0 && !thisForm.html_sig.value.length) {
retval = false;
errorinfo += "\n * Please complete the html E-mail signature in the upper edit field.\n";
}
if (thisForm.text_sig.value == 0 && !thisForm.text_sig.value.length) {
retval = false;
errorinfo += "\n * Please complete the text E-mail signature in the lower edit field.\n";
}
if (thisForm.title.value == 0 && !thisForm.title.value.length) {
retval = false;
errorinfo += "\n * Please give this E-mail signature a title.\n";
}
return retval;
}
many thanks