Link to home
Start Free TrialLog in
Avatar of Shahid-Abbasi
Shahid-Abbasi

asked on

problem in jquery jconfirm alert

Hi i am facing a problem after using jquery jconfirm alert. Issue is that after receiving confirm alert, when user press tab to go on Cancel button and press Enter key there, despite of firing event of Cancel button, it fires the event of OK button. this issue is not produced when user press the cancel button by mouse. Waiting for your replies.
Avatar of Rob
Rob
Flag of Australia image

that is because the default button for the form is the OK button.  Not sure if you can but change the OK button from type='submit' to type='button'  you might have to add onclick='this.form.submit()'
Avatar of Shahid-Abbasi
Shahid-Abbasi

ASKER

Hi

I think you did not got my point. Basically i am using jquery jconfirm alert. After confirm alert when you press tab to go on 'Cancel' button and press 'Enter' there then despite firing cancel event it fires 'Ok' button event, which is wrong. In my opinion this is the bug of jconfirm alert but i am not sure about that. You can also check this behaviour on this link. Press 'Show Confirm' button to dispaly confirm alert.

http://labs.abeautifulsite.net/projects/js/jquery/alerts/demo/
Just to clarify what type of
Button is the 'ok'?
It’s a default OK button of JConfirm.
Are you able to change it so that it isn't the default button,  also if you inspect the button at runtime what type of button is it?  what i'm getting at is if it is type='submit' then pressing enter anywhere in the JConfirm box will be liike pressing the OK button.

The only thing I can think of is that you test if the cancel button has focus when the OK button's onclick ev
The only thing I can think of is that you test if the cancel button has focus when the OK button's onclick event is pressed
ASKER CERTIFIED SOLUTION
Avatar of Shahid-Abbasi
Shahid-Abbasi

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
my own efforts