DEMO text input validation

Input :
Submit the form by clicking the button.


Javascript validation

HTML

<form name='form1' action='javascript_validation-demo.php' method='post' onSubmit='return validate();'>
Input :<input type=text name=textinput value=''> <br>
<div id='my_msg'>Submit the form by clicking the button.</div><br>
<input type=submit value=submit>
</form>

JavaScript

<script language="JavaScript" type="text/JavaScript">
<!--
function validate() {
if(document.form1.textinput.value=="")
{
document.getElementById('my_msg').innerHTML=" Fill the text box before submitting ";
///alert("Fill the Input box before submitting.");
return false;
}
else	{
return true;
}
}
//-->
</SCRIPT>

JavaScript Validation

Subscribe to our YouTube Channel here


Subscribe

* indicates required
Subscribe to plus2net

    plus2net.com







    Post your comments , suggestion , error , requirements etc here




    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2024 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer