3 ms·
If you really want to reduce the amount of JavaScript you write for validation, you should be using the jQuery Form Validation plugin. I know it's an extra but
by mmuro 14y ago
If you really want to reduce the amount of JavaScript you write for validation, you should be using the jQuery Form Validation plugin. I know it's an extra but who cares. It's totally flexible and you can validate your form in one line of code.
http://docs.jquery.com/Plugins/Validation/ http://docs.jquery.com/Plugins/Validation/
But yeah, ternary operators are a great way to save line space.