6 Replies Latest reply on Feb 8, 2013 5:45 AM by try67

    hiding fields based on value

    kharris85

      I have a script that I'm using to hide and show certain fields depending on what is entered in a certain field. The script looks like this:

       

      var t1 = this.getField("text1");
      var t2 = this.getField("text2");

       

      t1.hidden = true;
      t2.hidden = true;

       

      if (event.value >= "501")
      {  
      event.willCommit = true;
      {
      t1.hidden = false;
      }
      }
      if(event.value <= "500")
      {
      event.willCommit = true;
      {
      t2.hidden = false;
      }
      }

       

       

      The problem I'm having is it's only looking at the first 3 numbers that's put into the field. So if I type in "3000" it reads it as 300 and text1 shows up instead of text2. If i put in "6000" it shows the right field because it's reading it as 600. Is there another way I can write the script to make this work properly? Thank you in advance for your help!