PAN card number is a unique national number issued in India for tax related purposes.
Add jquery.js & jquery.validate Plugin
<script type="text/javascript" src="/js/jquery.js"></script> <script type="text/javascript" src="/js/jquery.validate.js"></script>
Create HTML Form
<form action="action_name" method="POST" id='myform'> <input type='text' name='pan'> <input type='submit' value='Submit' name='submit'> </form>
JQuery Validate Code
<script type='text/javascript'> $.validator.addMethod("pan", function(value, element) { return this.optional(element) || /^[A-Z]{5}\d{4}[A-Z]{1}$/.test(value); }, "Invalid Pan Number"); $("#myform").validate({ rules: { "pan": {pan: true}, }, }); </script>
No comments:
Post a Comment