I have this html
form, which does not actually sends data to a php file, buts sends data to a javascipt function.
Works fine if I hit the "Go" button, but if I choose something and hit "enter", does not work. Does not send the data to the function, that is.
I have made other forms with the same pattern, to send data to a javascript function in the same file and they work . This one refuses.
How do I fix this? Thanks
<form id="boroughform" enctype="multipart/form-data" method="post" action="#" onSubmit="return goborough(this); return false;" >
Choose borough:<br/>
<select name="boroughselect" id="boroughselect" >
<option selected value=" ">Choose...</option>
//fill the options with the results of a query performed eariler - works
<?php
for ($v=0; $v< sizeof($borough) ; $v++)
{echo '"<option value="'.$bid[$v].','.$bboxa[$v].','.$bboxb[$v].','.$bboxc[$v].','.$bboxd[$v].'" >'.$borough[$v].'</option>';}
?>
</select><br/>
<input type="submit" value="Go" name="postbor" class="formButton">
</form>
//the js
function goborough(g){
var binfo=g.elements['boroughselect'].value;
if(binfo!=" "){
//some cool openlayers staff here
return false;
}
else{alert('You have not chosen a borough !!! ');return false;}
}