I have the following piece of code
<td width="10%"/>
<td width="80%"><input type="checkbox" name="checkbox-mini-1" id="checkbox-mini-1" data-mini="true" onclick="javascript: toggleButton(this,'j_id0:LandingForm:ApproveButton');">
</input> <b>Yes, I accept</b></td>
<td></td>
<apex:commandButton id="ApproveButton" value="Register and Accept Invitation" style="display:none;width:125px;height:25px;font-weight:bold;font-size:12px;background-color:#f9f9f9;border-radius:6px;" action="{!loginAndAccept}"/>
<apex:commandButton id="LoginButton" value="Login and Accept Invitation" style="display:none;width:125px;height:25px;font-weight:bold;font-size:12px;background-color:#f9f9f9;border-radius:6px;" action="{!registerAndAccept}"/>
I want to display one of the two buttons above depending on the value of a variable hasuser which is present in the controller. There should be 2 conditions-1.checkbox clicked and value of hasuser is false, then first button gets displayed. 2. checkbox clicked and value of user is true, then the second button gets displayed . I am not being able to apply both the conditions simultaneously in the onclick. Fairly new to salesforce. Any help would be appreciated