.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Code Snippets >> Javascript >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Use Confirm box and External JavaScript Code For TextBox Validation

Posted By:NATHAN ISRAEL       Posted Date: October 06, 2012    Points: 40    Category: Javascript    URL: http://www.dotnetspark.com  

Use Confirm box and External JavaScript Code For TextBox Validation
 

HTML
*************
<html>
<head><title>Check Confirm_box Using Name</title></head>

<body>
<script language="javascript" src="Confirm_Box.js"></script>
<form name="formcheck">
    Enter Your Name : <input type="text" name="txtname" maxlenght="30">&nbsp&nbsp
    <input type="button" name="ok" onclick="check()" value="Submit">
    <input type="reset" name="clear" value="Clear">
</form>
</body>
</html>

JAVASCRIPT
*************
function check()
{
    s=formcheck.txtname.value;
    r=confirm("Your Name Is : "+s);
            if(r==true)
            {
                alert ("thank you");
            }
                else
            {
                alert ("Please Enter Your Name ");
            }
}


     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend