Skip to content

Commit f1e04b8

Browse files
committed
README
1 parent f7a7b35 commit f1e04b8

2 files changed

Lines changed: 27 additions & 5 deletions

File tree

README.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
# HTML Input Type SerialNumber
22
A new type of HTML Input field which is specially built for Serial Numbers. It assists the user while filling out the input field LIVE.
3+
34
## _LIVE_ Pattern Matching and Auto Completion
5+
46
### Pattern Matching
57
It test for the Regular Expression separately on separate pieces of the input, instead of all at once. The invalid characters __automatically get deleted__.
8+
69
### Auto Completion
710
Some Serial Numbers have separating characters, such as dashes, between the pieces. This input field __automatically adds__ those separators wherever required.
811

912
Since both these features LIVE, this software __assists__ the user while filling out the Serial Number, instead of simply pointing out that it was wrong.
13+
1014
## DEMO
11-
<input type=serialnumber>
15+
1216
## Installation
1317
1. Link jQuery version 3.x.x to the head of the page (if not already linked)
1418
```html
@@ -59,7 +63,23 @@ Since both these features LIVE, this software __assists__ the user while filling
5963
});
6064
</script>
6165
```
62-
4. Use the input type "serialnumber" anywhere in the page to test if it works.
66+
4. Use the input type `serialnumber` anywhere in the page to test if it works.
6367
```html
6468
<input type="serialnumber">
65-
```
69+
```
70+
71+
## Configuration
72+
__`separator:`__ This property can be defined for the whole input box in general, or specially for each separator. Specific definitions override the general ones. (Default value is an empty string `""`)
73+
__`pieces:`__ This is an array of the __`piece`__ objects.
74+
-------__`length:`__ A positive integer denoting the number of character in a piece. (Default value is `1`)
75+
-------__`pattern:`__ A [Regular Expression](https://www.w3schools.com/jsref/jsref_obj_regexp.asp) which defines the allowed characters in a piece.
76+
-------__`type:`__ Should be set to `separator` to add a separator, or else, should be left blank.
77+
78+
## Information
79+
Made as a plugin for jQuery
80+
Dependent on jQuery version 3.x.x
81+
82+
## Creator
83+
__Made By:__ _Ishpreet Singh Bhasin_
84+
[__Website__](http://ishpreet.tech/)
85+
[__GitHub__](https://github.com/ish-101/)

src/jquery.serialnumber.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
/*
22
HTML Input Type SerialNumber
3-
by Ishpreet Singh Bhasin (ish-101)
43
GitHub: https://github.com/ish-101/HTML-Input-Type-SerialNumber
5-
64
Dependency: jQuery 3.x.x
5+
License: GNU GENERAL PUBLIC LICENSE Version 3
6+
7+
Made by Ishpreet Singh Bhasin (ish-101)
8+
Website: http://ishpreet.tech/
79
*/
810

911
(function($)

0 commit comments

Comments
 (0)