4 Replies Latest reply on Feb 14, 2010 3:02 PM by ndjustin20

    Update/Refresh Form

    ndjustin20 Level 1

      Good Afternoon Everyone!!!!!!

       

      I have a question that is probably pretty simple I am guessing  i am using the following code if a user selects yes from the radio button options "yes" or "no" and yes = 1 which makes other fields required and no = 2  and those fields are no longer required.

       

      <event activity="click" name="event__click">

      <script contentType="application/x-javascript">

      if (RadioLocation.rawValue == "1") {

      if (DropDownList2.isNull) {

      DropDownList2.mandatory = "error";

      }

      }

      if (RadioLocation.rawValue == "1") {

      if (TextField23.isNull) {

      TextField23.mandatory = "error";

      }

       

      }

      </script>

      </event>

       

      Also, I am using the following if a user selects "no" from the radio button list:

       

       

      <event activity="click" name="event__click">

      <

      script contentType="application/x-javascript">

       

      if (RadioLocation.rawValue == "2") {

      DropDownList2.mandatory = "";

      TextField23.mandatory = "";

      xfa.host.resetData(DropDownList2);

      xfa.host.resetData("TextField23");

      }

        

        

      </

      script>

      </

      event>

       

       

      My only issue is this.  If a user selects Yes then changes their mind and selects No the red box around the odject doesn't go away and stays there.  If I try to email the form the object isn't required anymore and the red box goes away so I'm wondering how we can make  this happen in real time or create an event to update the form when a user makes that change.

       

       

      Justin

        • 1. Re: Update/Refresh Form
          $Nith$ Level 4

          DropDownList2.mandatory = "";

          TextField23.mandatory = "";

           

          Does the above scripts really working??

           

          Actually the script is suppose to be

           

          DropDownList2.mandatory = "disabled";

          TextField23.mandatory = " disabled";

           

          Nith

          1 person found this helpful
          • 2. Re: Update/Refresh Form
            ndjustin20 Level 1

            Hello Nith,

             

            Yes the code works great and has been very helpful.  The only piece of the puzzle I am missing now is the update/refresh script I would like to write to make the form update after someone changes their mind on an option so the required red box goes away.

            • 3. Re: Update/Refresh Form
              $Nith$ Level 4

              Could you post your form for a review?

               

              Nith

              1 person found this helpful
              • 4. Re: Update/Refresh Form
                ndjustin20 Level 1

                Greetings Nith,

                 

                Here is the form and now I am running into another problem.  I still need to figure out how to update the form with a script but more importantly I want the following code to work but for the life of me can't get it to run at all.  I am basically wanting to take the total of the rent and divide it by the sqft numeric field and place the result into the psf numeric field but for the life of me I can't figure out how to do this.  I have been trying the follwing to see if I can't get it to work:

                 


                if (NumericField13.isNull || NumericField13.rawValue == 0)

                {

                NumericField28.rawValue = "0"   

                }elseif(NumericField27.isNull || NumericField27.rawValue == 0){

                NumericField28.rawValue = "0"

                }else{

                     NumericField28.rawValue = NumericField13.rawValue / NumericField27.rawValue;

                }

                 

                 

                I have no idea what i am doing wrong and would love any advice or recommendations you may have as this division issue has been very frustrating as I've never had this many issues trying to divide two numbers programmatically.

                 

                Justin