12 Replies Latest reply on Dec 11, 2013 1:45 PM by Acp2621

    Reset Form Problem

    Acp2621

      I have a form that I am wanting to reset some, not all, of the fields for if a button is pushed. I've gotten that far using the MouseUp / Reset a form feature and only checking the fields that I was to reset. That part works fine.

       

      Now I am trying to add a layer that asks the user if they are sure that they want to do this prior to executing. I know I can write a javascript that will ask a yes or no question and execute a command based on the response. My problem is, the only way I know how to this is by listing all 140 fields I want to clear individually "this.getField("data")".

       

      I love the "reset a form" action and want to utilize it. I believe I can have a script that runs when the button is pushed that asks yes or no, and if no is selected, the whole process is aborted leaving everything as is. If yes is selected, it goes to the next step in the actions, which is Reset a Form. I've played with the some by setting up an alert to run before the reset and it works (meaning it goes in the right order).

       

      I think it would look something like this, I just dont know what the commmands would be...

       

       

      var cMsg = "This action will reset portions of the current form!!! \n\n";

      cMsg += "Are you sure you want to continue?";

      cMsg += "\n\nPress No to abort the reset process.";

      var nRtn = app.alert(cMsg,1,3);

      if(nRtn == 4)

      {

        //Not sure what to put here. The action would be to move to the next action in the list “Reset a form”

       

      }

      else if(nRtn == 3)

      {

        //Not sure what to put here. The action would be to abort the whole process like the button was never pushed.

      }

      else

      {

      // would be the same here as nRtn==3

      }