Hi everyone, I can't figure out how to submit my form when a user hits the enter key. Right now I have it that when the user hits the enter key the form is submitted, but it would be much nicer if they could just hit the enter key to submit.
I hope this was a very large typo or I've been up too long
Frank123
onClick
onSubmit
etc
etc I may not get it the 1st or 2nd time,
but how sweet that 15th time can be.
Sorry about that, it was a typo. What I wanted to say is the following:
Right now the user has to either tab down or click the "submit" button I created. I'd like to make this process easier by having the enter key act like the "submit" button.
I would use javascript onKeyPress. here's a example
<SCRIPT TYPE="text/javascript">
<!--
function submitenter(myfield,e)
{
var keycode;
if (window.event) keycode = window.event.keyCode;
else if (e) keycode = e.which;
else return true;
Is there a variation for VBS - esp. where a cmd button already has an event action assigned? Two questions in one here, I guess. 1) how to make a cmd button event fire by the enter key, 2) is it possible to include two event actions in the <input type="button" ...> definition? TY!
PS- my example is a one pager; client side only; Two input boxes to get input of a weight and convert lb/kg. Got the conversion and the rest. Wishing the 'calc' button can fire by keyboard as well.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.