2 Replies Latest reply on Apr 16, 2008 6:17 AM by (Joe_Courtney)

    JavaScript "variable" question

      The following Javascript is working fine. i.e. one text field shows and the other three will be hidden.

      if (event.target.value == "Yes") {
      this.getField("Reason4").hidden = true;
      this.getField("Reason1").hidden = false;
      this.getField("Reason2").hidden = true;
      this.getField("Reason3").hidden = true;

      }else{
      this.getField("Reason4").hidden = true;
      this.getField("Reason1").hidden = true;
      this.getField("Reason2").hidden = true;
      this.getField("Reason3").hidden = true;
      }

      What I would like to do is have any number of the text fields show. Say reason 1 & 3 or 1, 3 & 4 or say just 1. How do write this script?