You need to sign in to do that
Don't have an account?
anju
Can anybody help me to resovle issue in this visualforce code?
<apex:page standardController="My_Object__c" >
<h1>Testing</h1>
<br/>
<apex:pageBlock>
<apex:form>
Name <apex:inputField value="{!My_Object__c.Name}" required="true"></apex:inputField>
<br/>
DOB <apex:inputField value="{!My_Object__c.Date_of_Birth__c}"></apex:inputField>
<br/>
Test Text <apex:inputText value="{!My_Object__c.Note__c}" required="true" ></apex:inputText>
<br/>
<apex:commandButton action="{!save}" value="Save"></apex:commandButton>
</apex:form>
</apex:pageBlock>
<h1>Testing</h1>
<br/>
<apex:pageBlock>
<apex:form>
Name <apex:inputField value="{!My_Object__c.Name}" required="true"></apex:inputField>
<br/>
DOB <apex:inputField value="{!My_Object__c.Date_of_Birth__c}"></apex:inputField>
<br/>
Test Text <apex:inputText value="{!My_Object__c.Note__c}" required="true" ></apex:inputText>
<br/>
<apex:commandButton action="{!save}" value="Save"></apex:commandButton>
</apex:form>
</apex:pageBlock>
</apex:page>
The highlighted code is not working. In my visual force page 'Test Text' is not displaying as required and I can save without entering any value.
In object 'Note__c' is required field.
Can anybody tell me what is wrong in this code?
And also read this post, for information about requiredness.
This is true however the error message shown in this case is not user friendly?
Is there any way to customize the message shown to user?
j_id0:SiteTemplate:j_id17:ContactBlock:j_id52:j_id53:FirstName: Validation Error: Value is required.