", "upvoteCount": 0, "url": "https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007T4LA6SAN", "datePublished": "2018-12-13T15:37:47.000Z", "author": { "@type": "Person", "name": "Tyler Brooks", "url": "https://trailblazers.salesforce.com/profileView?u=0053A00000DptxEQAR", "affiliation": { "@type": "Organization", "name": "American Innovations" } } } ] } }
Skip to main content
I have some code for a page and I have it to where the submit button is greyed out if a checkbox is unchecked. However whenever you check the box it doesn't enable the submit button like i'm wanting. 

Here is my code 

<apex:page standardController="RMA__c">

<apex:form >

<apex:outputPanel id="thePanel" rendered="{!(RMA__c.RLI_has_QUOTE_SO__c == true)}">

<apex:pageBlock title="Confirm Information" mode="edit">

<apex:pageBlockSection title="Confirm the new field values" columns="2" rendered="{!(RMA__c.Show_the_box__c == true)}">

<apex:outputfield value="{!RMA__c.Contact__c}"/>

<apex:outputfield value="{!RMA__c.Shipping_Priority__c}"/>

<apex:outputfield value="{!RMA__c.Ship_to_Address__c}"/>

<apex:outputfield value="{!RMA__c.Bill_to_Address__c}"/>

<apex:inputfield value="{!RMA__c.Request_Priority__c}"/>

<apex:inputField value="{!RMA__c.Changes_are_reviewed__c}"/>

</apex:pageBlockSection>

<apex:pageBlockButtons >

<apex:commandButton action="{!save}" value="Submit" disabled="false" rendered="{!(RMA__c.Changes_are_reviewed__c == true)}"/>

<apex:commandButton action="{!save}" value="Submit" disabled="true" rendered="{!(RMA__c.Changes_are_reviewed__c != true)}"/>

</apex:pageBlockButtons>

</apex:pageBlock>

</apex:outputPanel>

</apex:form>

</apex:page>

And here is the page:

How to get submit button to be enabled after checkbox is checked on page?​​​​​​​
5 answers
  1. Dec 14, 2018, 3:37 PM
    So I figured out the answer to my question and the reason it wasn't working before, for others who are having this issue here is my code:

     

    <apex:page standardController="RMA__c">

    <apex:form >

    <apex:outputPanel id="thePanel" rendered="{!(RMA__c.RLI_has_QUOTE_SO__c == true)}">

    <apex:pageBlock id="TheBlock" title="Confirm Information" mode="edit">

    <apex:pageBlockSection id="theSection" title="Confirm the new field values" columns="2" rendered="{!(RMA__c.Show_the_box__c == true)}">

    <apex:outputfield value="{!RMA__c.Contact__c}"/>

    <apex:inputfield value="{!RMA__c.Shipping_Method__c}"/>

    <apex:outputfield value="{!RMA__c.Ship_to_Address__c}"/>

    <apex:outputfield value="{!RMA__c.Bill_to_Address__c}"/>

    <apex:inputfield value="{!RMA__c.Request_Priority__c}"/>

    <apex:inputfield value="{!RMA__c.Specific_Asset_Requested__c}"/>

    <apex:inputField value="{!RMA__c.Changes_are_reviewed__c}" id="reviewed">

    <apex:actionSupport event="onchange" rerender="thePanel"/>

    </apex:inputField>

    </apex:pageBlockSection>

    <apex:pageblockButtons id="button">

    <apex:commandButton value="Submit" action="{!save}" id="saveit" disabled="{!IF(RMA__c.Changes_are_reviewed__c!=true,true,false)}"/>

    </apex:pageblockButtons>

    </apex:pageBlock>

    </apex:outputPanel>

    </apex:form>

    </apex:page>

    The reason it wasn't work was because I was adding the onchange to the same line as the input field value for the checkbox, not doing the action Support in a seperate line like shown in my correct code.

    Hope this helps others!

    -Tyler
0/9000