How to shorten Javascript variable check?
Discussion
With most common tasks in web programming, others have already written it before. So rather than writing yourself and then testing it all, it is often more efficient to use something that is tried and trusted.
If you are using a framework of any kind then that will probably have validation built in, otherwise you can look at a separate javascript library.
You can also use HTML5 inbuilt features, for example
Maxlength: http://jsfiddle.net/xhqsB/1432/
input patterns: http://jsfiddle.net/xhqsB/1433/
If you are using a framework of any kind then that will probably have validation built in, otherwise you can look at a separate javascript library.
You can also use HTML5 inbuilt features, for example
Maxlength: http://jsfiddle.net/xhqsB/1432/
input patterns: http://jsfiddle.net/xhqsB/1433/
Edited by hyphen on Wednesday 6th December 15:46
Gassing Station | Computers, Gadgets & Stuff | Top of Page | What's New | My Stuff

