Here is the solution, you are looking for
HTML CODE:
<form id="myform" onsubmit="return myFunction()">
<input type="text" id="textbox">
<input type="submit" id="mysubmitid" value="Go">
</form>
JAVA SCRIPT:
HTML CODE:
<form id="myform" onsubmit="return myFunction()">
<input type="text" id="textbox">
<input type="submit" id="mysubmitid" value="Go">
</form>
JAVA SCRIPT:
$(document).ready(function()
{
$('#textbox').keypress(function(ev)
{
//If user pressed Enter Key then trigger Submit click
if(ev.keyCode==13)
$('#mysubmitid').click();
});
});
No comments:
Post a Comment