You need to sign in to do that
Don't have an account?
learnSF
customise required field message in visual force page
Hi,
I have visual force page where user can enter first name and last name. I made both fields as required with tag required="true" in input text.
I see that when user don't enter that field and hit register button, visual force shows message like "
- j_id0:j_id31:j_id36: Validation Error: Value is required." I want to customize this message as "Validation Error: Value is required".
Any help?
Thanks
This is a simple common problem, there are two approaches for this...
1) Give Id's across all hierachy. I.e., to pageblock, to form etc.
2) Chuck the 'required=true' thing and write a brand new error handling code, and when you have to display error, say...
object.fieldname.adderror('Some complicated confusing error to confuse the user to never use the system again.');
Hope it helps,
the Ravan
http://force.siddheshkabe.co.in
All Answers
This is a simple common problem, there are two approaches for this...
1) Give Id's across all hierachy. I.e., to pageblock, to form etc.
2) Chuck the 'required=true' thing and write a brand new error handling code, and when you have to display error, say...
object.fieldname.adderror('Some complicated confusing error to confuse the user to never use the system again.');
Hope it helps,
the Ravan
http://force.siddheshkabe.co.in