1 Reply Latest reply on Mar 19, 2014 7:33 PM by George_Johnson

    Reseting field properties

    MatLac Level 1

      I created a Button with a simple reset

       

      // ask question and capture response

      cResponse = app.alert("You are about to reset this form.  Do you want to proceed?", 2, 2);

      if(cResponse == 4) {

      // Yes response - then clear the form

      this.resetForm();

      }

       

      I just found out that it resets only the value property of the fields but not their default properties like "hidden" or "readonly".  Of course, some field on which this property is "calculated" do get back to default but not those that were included in a blur event for example.

       

      Is the only way out of this to add a hidden text field with a calculate script whenever I need to change those properties in case the user would hit the reset button?

       

      Like

       

      onBlur

      sometextfield.value = "OFF"

       

      then in the calculate script of the text field

      if event.value == "OFF"{

      allfields.hidden = true

      }

      else{

      allfields.hidden = false;

      }