enter submits a form...don't want it to
Posted: Wed Aug 24, 2005 10:35 am
A hidden div element I have. Use this element to show a search function I do. Two fields it contains.
when hitting enter on the text field, the "parent" form is submitted the problem is.
tried creating a function to check for the enter key I have
aware I am that works only in IE this does...the issue this is not.
prevent the form from submitting I need. Possible this is?
Code: Select all
<div id="searchdiv" class="slide">
<table class="tablez">
<tr>
<td>
<input type="radio" name="searchcri" value="school" checked="checked"> School Name<br>
<input type="radio" name="searchcri" value="district"> District<br>
<input type="radio" name="searchcri" value="state"> State<br>
<input type="radio" name="searchcri" value="firstname"> First Name<br>
<input type="radio" name="searchcri" value="lastname"> Last Name<br>
<input type="radio" name="searchcri" value="homephone"> Home Phone<br>
<input type="radio" name="searchcri" value="email"> Email Address<br>
<input type="text" name="searchstr" onKeyPress="checkEnt(event)">
<input type="button" value="go" onClick="searchIt(),slideEr('searchdiv',true);" class="butt">
</td>
</tr>
</table>
</div>tried creating a function to check for the enter key I have
Code: Select all
<script>
function checkEnt(evt)
{
if(evt.keyCode == 13)
{
searchIt();
slideEr('searchdiv',true);
return;
}
}
</script>prevent the form from submitting I need. Possible this is?