I have the following javascript function which is called from a apex:commandbutton
. hasuser
is a variable of the controller
function toggleButton(box, id1, id2) {
var user='{!hasuser}';
var elm1 = document.getElementById(id1);
var elm2 = document.getElementById(id2);
if(box.checked && user){
elm1.style.display = "";
else if(box.checked && !user)
elm2.style.display = "";
else{
elm1.style.display = "none";
elm2.style.display = "none";
}
}
Always the first button seems to be displayed.
No matter whatever the value of the user variable(true or false)..Can anyone tell me what is wrong? I can't figure it out.
user=='true'
anduser=='false'
– Ratan Paul Jan 7 '16 at 12:34