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
Venkat adityaVenkat aditya 

Visual force component check box checked then page block button should highlighten

Hi Professionals,

I have a visualforce page, i have some components in vfpage, and i have check box component in vf page, and page block button called 'search'
Now my scenario is when ever i checked the check box, then only vf page button(search) should be "Highlighten", If i should'nt check the checkbox then search button should not be in highlighten.

Please help with this task.

Thanks In advance.
Saurabh BSaurabh B
Try this,
 
<apex:page standardController="Opportunity" sidebar="false">
    <apex:sectionHeader title="Edit Opportunity" subtitle="{!opportunity.name}"/>
    <apex:form >
        <apex:pageBlock title="Edit Opportunity" id="thePageBlock" mode="edit">
            <apex:pageMessages />
            <apex:pageBlockButtons >
                <apex:commandButton value="Save" action="{!save}"/>
                <apex:commandButton value="Cancel" action="{!cancel}"/>                
            </apex:pageBlockButtons>
            <apex:actionRegion >
                <apex:pageBlockSection title="Basic Information" columns="1">
                    <apex:inputField value="{!opportunity.name}"/>
                    <apex:pageBlockSectionItem >
                        <apex:outputLabel value="Checkbox"/>
                        <apex:outputPanel >
                            <apex:inputField value="{!opportunity.Checkbox__c}">
                                <apex:actionSupport event="onchange" rerender="thePageBlock"
                                                    status="status"/>
                            </apex:inputField>
                            <apex:actionStatus startText="applying value..." id="status"/>
                        </apex:outputPanel>
                    </apex:pageBlockSectionItem>
                    <apex:inputField value="{!opportunity.amount}"/>
                    <apex:inputField value="{!opportunity.closedate}"/>
                </apex:pageBlockSection>
            </apex:actionRegion>
            <apex:pageBlockSection title="Disabled" columns="1"
                                   rendered="{!opportunity.Checkbox__c == True}">
			<apex:commandButton action="{!save}" value="Save" id="theButton1" disabled= "True" />
            </apex:pageBlockSection>
            
             <apex:pageBlockSection title="Enabled" columns="1"
                                   rendered="{!opportunity.Checkbox__c == False}">
			<apex:commandButton action="{!save}" value="Save" id="theButton2" disabled= "False"/>
            </apex:pageBlockSection>

            
        </apex:pageBlock>
    </apex:form>
</apex:page>

Please mark this as Best Answer if it helps you!