0 Replies Latest reply on Feb 19, 2012 9:47 AM by srinivas1506

    JS for the below simple IF statement pls.?

    srinivas1506 Level 1



      I am new to JavaScript, could you pls. consolidate the below 2 IF statements into only 1 summary IF statement (I mean, put the red IF statement into blue IF statement)


      my_form:Page1:SunForm1:Middle_Name_text_field ::: Change JavaScript


      I wrote the below code in the CHANGE event of a text field of "Middle_Name_text_field"

      // Hide associated check box
      // As soon as user started entering the data, make associated check box as invisible
      // or if erased the data again then make the check box visible


      if (xfa.event.newText.length > 0) {
           MiddleName_CheckBox.presence = "hidden";
      else {

      // I guess, the below red piece should come here
           MiddleName_CheckBox.presence = "visible";

      var yc  //Yellow color
      yc = " "
      yc = (this.ui.oneOfChild.border.fill.color.value);

      // If the Middle Name text field is colored with yellow, then make it again invisible, no matter wht the above IF statement yileds in


      if (yc == "255,255,191") {
           MiddleName_CheckBox.presence = "hidden";


      Thank you