You need to sign in to do that
Don't have an account?
sreenath
Getting id error
Hi,
I got the below error in visual force page. When we put the inputtext attribute as required=true. Please suggest any required messages to remove this id error message.
j_id0:j_id1:j_id30: Validation Error: Value is required
Thanks,
Sreenath.
code sample please...
Use the "id" attribute to specific a name, ie: "inputTextBox" for this inputText.
The error message would become:
"inputTextBox: Validation Error: Value is required"
When you set "required=true", it check if a value is entered. If not, it would throw this gives error message.
The other way is to remove the required attribute from the input text and put some JavaScript validation on page submit. In JavaScript check if that input text field is blank then show some alert message. Below is the sample code :
<input id="TextId" value="" name="search_block_form" />
<input value="Search" id="edit-submit-3" onclick="validate();">
<script>
function validate()
{
var chapterName = document.getElementById('TextId').value;
if(chapterName == '')
alert('Chapter name is required.');
}
</script>