javascript - How to find two default submit buttons when i press the Enter key in asp.net using jquery? -


i have 2 default submit button in single web page.. 1 in main form.. , 1 button inside div control.. div control popup @ login button click event.. when popup div.. div has submit button , when press enter key.. button needs submit.. if div closed.. press enter key main form submit button need submit values.. how can find 2 submit buttons on enter key press using jquery? please help. thank you..

when popup shows up, set focus submit button of popup div:

$('div.popupclass').find('button[type="submit"]').focus(); 

and, when popup closed, switch focus main form:

$('body').find('button[type="submit"]').focus(); 

if using jquery-ui's dialog, put lines in open: , close: calls.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -