0

I have used this jAlert plugin for popups in my form.But i cant figure out how to determine if OK or Cancel is clicked in it.

I have this code.

var ret = jConfirm('Are you sure to join this Church/Npo?',function (r){

Which doesnt works for me.I also have used CallBack but to no avail.

Please help,

Regards Himanshu Sharma

Ben Everard
  • 13,652
  • 14
  • 67
  • 96
techie_28
  • 2,123
  • 4
  • 41
  • 62

1 Answers1

3

You missed one parameter.

  jConfirm('Some Title', 'Are you sure to join this Church/Npo?', function(r) {
    alert(r);
  });

The syntax is:

jConfirm(title, text, function)

You only have text and function. That is why you do not get a result inside the function.

See jConfirm with this existing code

Community
  • 1
  • 1
PiTheNumber
  • 22,828
  • 17
  • 107
  • 180
  • i dont understand which pstsm hsve i missed..let me know plz – techie_28 Dec 12 '11 at 15:45
  • You missed the window title. See above. – PiTheNumber Dec 12 '11 at 16:16
  • I am not concerned about the title.I am just concerned about how to know if OK is clicked or CANCEL is clicked so i can submit or not submit the form on its response.Please tell me that, – techie_28 Dec 12 '11 at 16:26
  • You should be concerned about how a function is defined if you want to use it! Did you try the code above? What does the alert give you if you press ok? You just need to replace the alert with an `if(r)`. – PiTheNumber Dec 12 '11 at 16:40
  • it alerts before the OK or cancel is pressed – techie_28 Dec 12 '11 at 17:00
  • Does it? Doesn't sound right... but I guess the alert message ist empty. What do you get if you press ok or cancel? Nothing => something is wrong. Else => create a if and check for this message. – PiTheNumber Dec 13 '11 at 09:48
  • Also is it possible to change OK and CANCEL text in the confirmation alert box? – techie_28 Dec 16 '11 at 09:39