1 Reply Latest reply on Mar 17, 2015 8:46 AM by try67

    Getting a field to print when two checkboxes are checked

    BillyOGuy

      I'm trying to get a field to print when two checkboxes are checked ("MEMBER_MARRIED_YES" and "SPOUSE_MEDICARE_UNDER_YES"). So, the idea is that if both these chkboxes are checked it will print the spouse's name into the text field from another text field that already has the spouse's name in it. If only one chkbox is checked, the text field will remain blank. If neither chkbox is checked, the text field will remain blank. Here is my code below:

       

      function spousemedicare()

      {

       

      if((this.getField("MEMBER_MARRIED_YES").isBoxChecked(0,true)) && (this.getField("SPOUSE_MEDICARE_UNDER_YES").isBoxChecked(0,true)))

      {

       

      this.getField("SPOUSE_NAME").value= this.getField("SPOUSE_FULL_NAME").value;

       

      }

      else if((this.getField("MEMBER_MARRIED_YES").isBoxChecked(0,false)) && (this.getField("SPOUSE_MEDICARE_UNDER_YES").isBoxChecked(0,false)))

      {

      this.getField("SPOUSE_NAME").value="";

      this.getField("SPOUSE_POLICY_NYMBER").value="";

      this.getField("SPOUSE_MEDICARE_PLAN").value="";

      this.getField("SPOUSE_HICN").value="";

      }

      }