jquery - Display alert if conditions are met, almost like onbeforeunload -


I have a broken form in 5 steps. Currently if you are fresh / exit / close at step 2-4 Etc., then it gives a message through the window. There is no problem after this. $ (": #" 2) "(visible"). $ (": #" 3) Browse back, refresh or close button, you will lose all the form data. Please use the front and back buttons on the form. ';}}

Now let me step 1 ( The first step) is to add one or the same type of behavior if the checkbox "A" is checked and the check box is not "B". It works but is not combined with any other. O Nfenforeload function

  window.onbeforeunload = function () {if ($ ("#A"). (": Checked") & amp; $ ("#b"). (": Not checked (checked)")) {return 'message is here.Do you want to continue?';}}  

How do I get the two together If I do not seem to use another narrative.

It can be added to:

  window.onbeforeunload = function () {if ($ ("($ (" #A "). (": Checked ") & amp; !! ("# B"). (": Check")) {return 'message here. Do you want to continue?'; } (Return ($ ("# step1, # step2, # step3"). Filter (": visible"). Length) {Return 'You will lose all form data using the browser backup, refresh or close button. Please use the front and back buttons on the form. ';}}  

I have simplified all your selectors to capture all the elements and see if any (> 0) This is an easy-to-go, easy-to-know method.

In addition to this, if you have an additional form at if If you want to add a link, make sure you are at that stage, such as:

  if ($ ('# step0') is' (': view') & amp; amp ; "(Checked:") (": checked") & amp; !! ("#b"). (": Checked")) { 

Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -