2 Replies Latest reply on Aug 1, 2011 2:03 PM by check box

    How can roll back when hit of clear out?

    check box

      Hi

       

      I have 2 check boxes. Under each box there is a text field. the 2nd text field is disable when the 1st CheckBox in ON. and the 1st text field is disable when the 2nd CheckBox in ON.

       

      Here is the 1st CB code

       

      if(event.target.value !== "Off")
      {
      DisableFormField("Text2");
      EnableFormField("Text1");
      }

      else
      {
      DisableFormField("Text1");
      }

      // Function to disable form fields
      function DisableFormField(cFieldName)
      {
         // First acquire the field to be disabled
         var oFld = this.getField(cFieldName)
         if(oFld)
         {
          oFld.value=""
            // Make field Read-Only
            oFld.readonly = true;
         }
      }

      // Function to enable form fields
      function EnableFormField (cFieldName)
      {
         // First acquire the field to be enabled
         var oFld = this.getField(cFieldName)
        if(oFld)
         {
            // Make field interactive
           oFld.readonly = false;
       
         }
      }


      I like to know when I hit clear out I like to get all disable fields are enable. How can I avoid?

       

       

       

        • 1. Re: How can roll back when hit of clear out?
          gkaiseril MVP & Adobe Community Professional

          What is the purpose of the statement:

           

          if(oFld)

          ?

           

          oFld is an object. Are you trying to test the existence of the field object, the value, the type of property, if the field is R/O, or what?

           

          You have not very clearly describing your problem.

           

          I find checking for the positive or the non-off value for a check box to be more reliable for taking action. With 2 check boxes, you can can three different states, check box 1 selected, check box 2 selected, and nothing selected. You need to have code for each of these states.

           

           

           

          • 2. Re: How can roll back when hit of clear out?
            check box Level 1

            Hi,

             

            I used read only option for text fields and check boxes to enable or disable the fields. When I do clear out data the last event action exist. how i can avoid that?