goddess_spanky
August 15th, 2001, 11:32 AM
Does any know of a good forum for advanced HMTL & JavaScript help? Maybe someone here could help?
I have a submit button that calls an ASP script, but before the script is executed, I have a javascript that checks the search form for value(s). If there is no data in the search form, I have an alert come up and then I have this: "document.frmSearch.cancelEvent = TRUE"
For some reason, the submit event is not cancelled. I get the alert, but the ASP script is still executed?
Yesterday it worked fine and now it is not working today! Any ideas?
Here is the javascript:
<SCRIPT LANGUAGE="JAVASCRIPT">
function checkForm() {
if (document.frmSearch.acctno.value=='' &&
document.frmSearch.login.value=='' &&
document.frmSearch.interval.value=='' &&
document.frmSearch.site.value=='' &&
document.frmSearch.fname.value=='' &&
document.frmSearch.lname.value=='') {
alert('Please complete at least 1 field in the search form');
document.frmSearch.cancelEvent = true;
}
else {
//'document.frmSearch.submit();
}
}
</SCRIPT>
~goddess
goddess_spanky@hotmail.com
I have a submit button that calls an ASP script, but before the script is executed, I have a javascript that checks the search form for value(s). If there is no data in the search form, I have an alert come up and then I have this: "document.frmSearch.cancelEvent = TRUE"
For some reason, the submit event is not cancelled. I get the alert, but the ASP script is still executed?
Yesterday it worked fine and now it is not working today! Any ideas?
Here is the javascript:
<SCRIPT LANGUAGE="JAVASCRIPT">
function checkForm() {
if (document.frmSearch.acctno.value=='' &&
document.frmSearch.login.value=='' &&
document.frmSearch.interval.value=='' &&
document.frmSearch.site.value=='' &&
document.frmSearch.fname.value=='' &&
document.frmSearch.lname.value=='') {
alert('Please complete at least 1 field in the search form');
document.frmSearch.cancelEvent = true;
}
else {
//'document.frmSearch.submit();
}
}
</SCRIPT>
~goddess
goddess_spanky@hotmail.com