4 Replies Latest reply on Jul 28, 2014 9:45 AM by myDavey

    How to alert and keep dialog open?

    myDavey Level 1

      Hello,

      I have a dialog which needs to have parameters filled in.

      If the user misses something, I want to alert him and have the dialog stay open.

      My "code" is:

      if (w.show() == 1){
           if settings not filled in, alert and exit();
           do work
      }else{ exit() }
      

       

      The problem with this is that this way, the dialog will close and the user has to rerun the script.

       

      So, I made an onClick function for the OK button which checks these settings and alerts if missing.

      However, now the main function is not getting executed! Pressing ok does nothing (besides checking).

       

      So I tried calling the main function from the onClick function...

      but then I get an error message "Cannot handle the request because a modal dialog or alert is active"

       

       

      What is the correct way to do this?

      How can I alert him if something is missing, but keep the dialog open?

       

       

      Thanks

      David