Hi,
Javascript below doesn't work. It always retuns false. Where is mistake?
thanks
<script Language="JavaScript">
function validateAreas(){
if (document.form1.selectS.value=="") {
alert("Please select a S");
form1.selectS.focus();
return false;
}
return true;
}
</script>
<form name="form1" method="post" action="" onSubmit="return validateAreas();">
.....
<select name="selectS">
<option selected="selected"></option>
<?php
$q="SELECT id FROM spp";
$run=mysql_query($q);
if (@mysql_num_rows($run)>0) {
while ($new=mysql_fetch_array ($run, MYSQLI_ASSOC)) {
?>
<option><?php echo $new['id']; ?></option>
<?php
}
}
?>
</select>
<input type="submit" name="Submit" value="Send">