jquery

JQUERY CNIC FORMAT

The following script shows how to auto-set the format of CNIC number using jQuery while typing in the input field.

Format of CNIC is xxxxx-xxxxxxx-x

While typing numbers of your CNIC, “-” should be automatically inserted at correct places.
For this purpose you will have to use keydown function.

 

 

 

$(this).val().length gets the length of string typed.