Hi guys,
What I have is a form that uses some javascript to do some basic checking but I can't seem to stop the Submit with the statement even if I leave the box blank:
return False;
here is the code
<script language = javascript>
<!--
function Validate(){
if (document.Report.StartDD.value ==""{
alert ("Please enter a number for the Day field"
document.forms.focus();
return false;
}
...same code for all boxes....
return true
}
-->
</script>
<form name = Report action = ReportStatus.asp method = post onSubmit = return "Validate();">
<table><tr><td size = 25>Enter Start Date</td><td>
<input name = StartDD type = text size = 2 maxlength = 2><b>--</b>
<input name = StartMM type = text size = 2 maxlength = 2><b>--</b>
<input name = StartYY type = text size = 4 maxlength = 4>
<tr><td size = 25>Enter End Date</td><td>
<input name = EndDD type = text size = 2 maxlength = 2><b>--</b>
<input name = EndMM type = text size = 2 maxlength = 2><b>--</b>
<input name = EndYY type = text size = 4 maxlength = 4></td>
<td><input type = submit name = submit value = Submit >
can anyone spot what I am doing wrong...I an't seem to figure it out...
thanks
Bastien
What I have is a form that uses some javascript to do some basic checking but I can't seem to stop the Submit with the statement even if I leave the box blank:
return False;
here is the code
<script language = javascript>
<!--
function Validate(){
if (document.Report.StartDD.value ==""{
alert ("Please enter a number for the Day field"
document.forms.focus();
return false;
}
...same code for all boxes....
return true
}
-->
</script>
<form name = Report action = ReportStatus.asp method = post onSubmit = return "Validate();">
<table><tr><td size = 25>Enter Start Date</td><td>
<input name = StartDD type = text size = 2 maxlength = 2><b>--</b>
<input name = StartMM type = text size = 2 maxlength = 2><b>--</b>
<input name = StartYY type = text size = 4 maxlength = 4>
<tr><td size = 25>Enter End Date</td><td>
<input name = EndDD type = text size = 2 maxlength = 2><b>--</b>
<input name = EndMM type = text size = 2 maxlength = 2><b>--</b>
<input name = EndYY type = text size = 4 maxlength = 4></td>
<td><input type = submit name = submit value = Submit >
can anyone spot what I am doing wrong...I an't seem to figure it out...
thanks
Bastien