-
Prospect
javascript validation
<script type="text/javascript">
function setMessage(message)
{
mdiv = document.getElementById("userIdMessage");
if (message == "invalid")
{ mdiv.innerHTML =
"<div style=\"color:red\">Invalid User Id</ div>";
}
else
{ mdiv.innerHTML =
"<div style=\"color:green\">Valid User Id</ div>";
}
}
</script>
<body>
<div id="userIdMessage"></div>
</body>
-
Prospect
JavaScript can be used to validate data in HTML forms before sending the content to a server
-
Prospect
Hi..i provides easily understandable alphabet text field validation scripts here...
<html>
<head>
<script type='text/javascript'>
function isAlphabet(elem, helperMsg){
var alphaExp = /^[a-zA-Z]+$/;
if(elem.value.match(alphaExp)){
return true;
}else{
alert(helperMsg);
elem.focus();
return false;
}
}
</script>
</head>
<body>
<form>
Letters Only: <input type='text' id='letters'/>
<input type='button'
onclick="isAlphabet(document.getElementById('lette rs'), 'Letters Only Please')"
value='Check Field' />
</form>
</body>
</html>
Cegonsoft
-
Sapphire Star member
JavaScript is used to validate the data in HTML forms before sending the content to the server..
Examples of thejava script:
Games
Quake II GWT Port
Akihabara CapMan
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules