Member • Jul 8, 2011
-
sanjay99091get your source code for validation in a web page
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a
member of our community. Consider creating an
account or login.
Replies
-
Member • Jul 12, 2011
What do you exactly want to know? Can you please be elaborate?Are you sure? This action cannot be undone. -
Member • Jul 26, 2011
Hi..i provide simple text field validation using JavaScript,
<html>
<head>
<script type='text/javascript'> function formValidator()
{ // Make quick references to our fields var firstname = document.getElementById('firstname');
if(isAlphabet(firstname, "Please enter only letters for your name"))
{
return true;
}
return false;
}
function notEmpty(elem, helperMsg)
{
if(elem.value.length == 0)
{
alert(helperMsg);
elem.focus(); // set the focus to this input
return false;
}
return true;
}
</script>
</head>
<body>
<form onsubmit='return formValidator()' >
First Name: <input type='text' id='firstname' />
<input type='submit' value='Check Form' />
</form>
</body>
</html>
------------------
link removedAre you sure? This action cannot be undone. -
Member • Jul 27, 2011
@Moorvidya: Please explain me these things:moorvidyaHi..i provide simple text field validation using JavaScript,
<html>
<head>
<script type='text/javascript'> function formValidator()
{ // Make quick references to our fields var firstname = document.getElementById('firstname');
if(isAlphabet(firstname, "Please enter only letters for your name"))
{
return true;
}
return false;
}
function notEmpty(elem, helperMsg)
{
if(elem.value.length == 0)
{
alert(helperMsg);
elem.focus(); // set the focus to this input
return false;
}
return true;
}
</script>
</head>
<body>
<form onsubmit='return formValidator()' >
First Name: <input type='text' id='firstname' />
<input type='submit' value='Check Form' />
</form>
</body>
</html>
1. Where is the function isAlphabet been defined?
2. Where is firstname defined? (It is already commented out!)
3. Where is notEmpty() function called?
4. Why have you placed a link to an irrelevant website?
If you are qualified, please respond to the post. The reply you have given, copied from tizag, that too not fully, is a BS. Please don't spam a place where you are not supposed to spam! 😲 Make sure this is not happening again.
@Sanjay: Please say the fields in your form and which are need to be validated. Thanks.Are you sure? This action cannot be undone.