• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2317
  • Last Modified:

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.
0
Shahid-Abbasi
Asked:
Shahid-Abbasi
  • 4
  • 4
1 Solution
 
RobOwner (Aidellio)Commented:
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()'
0
 
Shahid-AbbasiAuthor Commented:
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/
0
 
RobOwner (Aidellio)Commented:
Just to clarify what type of
Button is the 'ok'?
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
Shahid-AbbasiAuthor Commented:
It’s a default OK button of JConfirm.
0
 
RobOwner (Aidellio)Commented:
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
0
 
RobOwner (Aidellio)Commented:
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
0
 
Shahid-AbbasiAuthor Commented:
ok my issue has been solved i add an event in cancel button
in "jquery.alerts.js" file

onkeypress="javascript:$.alerts._hide();"
0
 
Shahid-AbbasiAuthor Commented:
my own efforts
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now