function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Radha Rathinavel 1Radha Rathinavel 1 

How to show/hide my input type button in visualforce page

Hi,
I have to show/hide my input button type in visual force page depends on my case record using case id, when my checkbox field is true
My Code:

<apex:page showHeader="false" sidebar="false">
    <apex:includeScript value="/apex/dsfs__DocuSign_JavaScript"/>
    <script type="text/javascript">
    
      
        function redirectFunct()
    {
            var caseId= '{!$CurrentPage.parameters.id}';
       
         window.open('/apex/dsfs__DocuSign_CreateEnvelope?DSEID=0&SourceID='+currentUrl);  
         return false;
        }

    </script>
 
    <input type="button" value="ESIGN" onclick="redirectFunct()"/>
   
  </apex:page>
Naval Sharma4Naval Sharma4
This can be done using either css or rendered attribute on apex component.
<apex:outputPanel rendered="{!    YOUR CONDITION  }">
     <input type="button" value="ESIGN" onclick="redirectFunct()"/>
</apex:outputPanel>


You should be using StandardController on <apex:page> so you will have access to case properties ( fields) and you can use them in the rendered condition.
bhanu_prakashbhanu_prakash
Hi Radha,
Mark as best answer, If it resloves !!
Use below script 
<apex:page showHeader="false" sidebar="false" lightningStylesheets="true">
    <script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
    <apex:slds/>
    <script type="text/javascript">
        $(document).ready(function() {
        	$('#clicked').css('display', 'none');
        	$('#red').click(function() {
          		$('#clicked').toggle();
        	});
      });
    </script>
    <div>
        <label><input type="checkbox" name="colorCheckbox" value="red" id="red"/> red</label>
    </div>
    <div class="red box">
        <button type="button" id="clicked">Click Me!</button>
    </div>
</apex:page>
Mark as resloved if it helps :) :)
Thanks, 
Bhanu Prakash
visit ForceLearn.com​  (https://www.forcelearn.com)