Introduction
Here is a validation code for a bank IFSC code.
IFSC code format:
- Starting 4 should be only alphabets[A-Z]
- Remaining 7 should accept only alphanumeric
Code
- <script type="text/javascript">
- $(document).ready(function(){
-
- $(".ifsc").change(function () {
- var inputvalues = $(this).val();
- var reg = /[A-Z|a-z]{4}[0][a-zA-Z0-9]{6}$/;
- if (inputvalues.match(reg)) {
- return true;
- }
- else {
- $(".ifsc").val("");
- alert("You entered invalid IFSC code");
-
- return false;
- }
- });
-
- });
- </script>
-
- IFSC : <input type="text" class="ifsc">