Right so a form validator is supposed to stop any information being sent to be processed?
My form does retrurn the error but as soon as i close the alert box the form is processed.
very strange
My script:
<script language="JavaScript" type="text/JavaScript">
<!--
function validate() {
if (document.form1.folder_id.value == "") {
alert ("Please enter your Event title");
document.form1.folder_id.focus();
return false;
}
return true;
}
</script>
</head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>
<body bgcolor="#D4D0C8" leftmargin="5" topmargin="5" marginwidth="0" marginheight="0">
<form name="form1" action="galAddimage.php" method="post" onSubmit="validate();" >
<table width="914" height="57" border="1">
<tr>
<td colspan="2">MXGB Gallery upload form...</td>
<td colspan="2">Event Date:
<input name="eventDate" type="text" id="eventDate" value="00/00/00" size="12">
(If left blank current date will be used!)</td>
</tr>
<tr>
<td width="323">Select number of images to upload, limit 10 per page </td>
<td width="92">
<select name="numOfUpload">
<option value="1" selected>1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
</select>
<input type="submit" name="Submit" value="Go"></td>
<td width="287">Event title:
<input name="folder_id" type="text" id="folder_id" size="30"value="<? echo $folder_id; ?>"></td>
<td width="184"> </td>
</tr>
</table>
</form>
Anyone
Cheers
Paul