You need to sign in to do that
Don't have an account?

displaying a field once a checkbox is set to true
I have added the below on visualforce page and added to a page layout but it does not display properly. Can you have a look and let me know what is wrong with the code or do I need to write a full visualforce page with the fields.
<apex:page standardController="Service_Request__c" showHeader="true"> <apex:pageBlock > apex:inputText value="{!Service_Request__c.Useful_SQL__c}" rendered="{!(Service_Request__c.Is_this_useful__c == true)}"/> </apex:pageBlock> </apex:page>
<apex:page standardController="Service_Request__c" showHeader="true"> <apex:pageBlock > apex:inputText value="{!Service_Request__c.Useful_SQL__c}" rendered="{!(Service_Request__c.Is_this_useful__c == true)}"/> </apex:pageBlock> </apex:page>
<apex:page standardController="Service_Request__c" showHeader="true">
<apex:pageBlock >
<apex:form><!--Input fields need to be placed inside of apex:form tags-->
<!--you forgot the the opening tag for this inputText field.--> <apex:inputText value="{!Service_Request__c.Useful_SQL__c}" rendered="{!Service_Request__c.Is_this_useful__c}"/><!-- since this is using a boolean field all you have to do is enter it since it will always only be true or false-->
</apex:form>
</apex:pageBlock>
</apex:page>
hope this helps somewhat
All Answers
<apex:page standardController="Service_Request__c" showHeader="true">
<apex:pageBlock >
<apex:form><!--Input fields need to be placed inside of apex:form tags-->
<!--you forgot the the opening tag for this inputText field.--> <apex:inputText value="{!Service_Request__c.Useful_SQL__c}" rendered="{!Service_Request__c.Is_this_useful__c}"/><!-- since this is using a boolean field all you have to do is enter it since it will always only be true or false-->
</apex:form>
</apex:pageBlock>
</apex:page>
hope this helps somewhat
<apex:commandButton value="Save" action="{!save}"/>
after the input field inside the <apex:form> tags.
<apex:page standardController="Service_Request__c" showHeader="true">
public string
<apex:pageBlock >
<apex:pageBlocksection >
<apex:form >
<apex:outputText value="Enter the useful SQL in the text field provided below" />
<apex:inputField value="{!Service_Request__c.Useful_SQL__c}" rendered="{!(Service_Request__c.Is_this_useful__c == true)}"/>
<apex:commandButton action="{!save}" value="Save" />
</apex:form>
</apex:pageBlocksection>
</apex:pageBlock>
</apex:page>
When using the command button it displays the same page in the visualforce page