开发者

Rails: On tab click submit a form

开发者 https://www.devze.com 2023-03-09 12:19 出处:网络
I have a form that I would like to be submitted when you click the tab button on you开发者_运维技巧r keyboard. I think I\'m doing with my own code... How will I do this?myElement.keydown = function (e

I have a form that I would like to be submitted when you click the tab button on you开发者_运维技巧r keyboard. I think I'm doing with my own code... How will I do this?


myElement.keydown = function (e) {
  if (e.which === 9) myForm.submit();
};

9 is the tab character. I think this is x-browser compatible.

0

精彩评论

暂无评论...
验证码 换一张
取 消