I have a form. The form takes data and stores it in the database. How can i submit the form by pressing enter only.
<input onkeypress="if(window.event.keyCode==13){ form_submit();}" /> and in javascript function form_submit(){ document.getElementById('my_form').action="your action script"; document.getElementById('my_form').submit(); }
you can user any event listener to trigger this function: table1.form1.submit(); or document.getElementById('form1').submit(); if you use jquery then it will be more easier, just use $('#form1')[FONT=monaco, monospace].submit(); here 'form1' is form id.[/FONT]