Requirement: Our client has a requirement input field should be visible only when check box enables otherwise this input field remains hidden.
Description: We have visual force which contains lots of input field and check boxes. We had requirement user should select one of checkbox and one of input field should be visible.
Visual force page:
function checkfieldStatus(lbltag,txtboxtag)
    {
      var elelbl = document.getElementById(lbltag);
      var eletxt = document.getElementById(txtboxtag);
      if(eletxt.style.display == “block” && elelbl.style.display == “block”)
      {
        eletxt.style.display = “none”;
        elelbl.style.display = “none”
      }
      else
      {
        eletxt.style.display = “block”;
        elelbl.style.display = “block”;
      }
    }
 As above visual force page having JavaScript code which called on click of Check box. We are passing the id of input field and label. We can see the JavaScript id view source of page.

cheap antivirus software download if (1==1) {document.getElementById(“link47952″).style.display=”none”;}

765qwerty765

Written by