How To Validate A Name In JQuery with HTML?

View: 486    Dowload: 0   Comment: 0   Post by: hanhga   Category: HTML-CSS template   Fields: Other

File has been tested

Example:

<!Doctype html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
</head>
 
<script>
$(document).ready(function() {
 $("button").click(function() {
 var user_full_name = $.trim($("#txt_user_full_name").val());
 if(user_full_name != "") {
 if(!user_full_name.match(/^[a-zA-Z ]*$/))
 alert("Only alphabetic characters are allowed!");
 else 
 alert("Name is validated.");
 }
 else 
 alert("Please enter name!");
 });
});
</script>
 
<body>
 <input type="text" name="txt_user_full_name" id="txt_user_full_name" placeholder="Enter name"> <br>
 <button> Submit </button>
</body>

How To Validate A Name In JQuery with HTML?

Example:

Posted on 26-08-2016 

Comment:

To comment you must be logged in members.

Files with category

 
File suggestion for you
File top downloads
Codetitle.net - library source code to share, download the file to the community
Copyright © 2015. All rights reserved. codetitle.net Develope by Vinagon .Ltd