0

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">
1
Contributor
1
Reply
2
Views
9 Years
Discussion Span
Last Post by veledrom
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.