JS Validation

180 views
Skip to first unread message

TheSin

unread,
Apr 23, 2013, 5:05:55 PM4/23/13
to php-form-bu...@googlegroups.com
I started working on JS Validation, right now it only adds the error class to highlight and show errors prior to submit, I'll working this a little more to disable the submit button this it validates and maybe disable the error messages for errors on the fly.

Currently nothing is needed at all it just copies the validate code and converts it to JS, so nothing is required but the patch and it'll just work.  I only converted Alphanumeric and Required to date but I just started on this like 30 minutes ago.  And I just wanted to share incase the Author wanted to incorp this and I going in the wrong direction from his thoughts.

Hope you all enjoy it, as I add others I'll update here.
PFBC-JS-Validate.patch

TheSin

unread,
Apr 24, 2013, 6:31:28 PM4/24/13
to php-form-bu...@googlegroups.com
Okay first attempt was very fast and weak

This is a MUCH more robust version, it now disabled and enabled the submit button and works with Regex, AlphaNumeric and Required.

I'm sure it's still not perfect but it's working very very well for me, I'll continue to try and expand it and I assume the author should add a switch to enable/disable the JS validation option if he adds it which I hope he does cause it's very useful IMHO.
PFBC-JS-Validate.patch

TheSin

unread,
Apr 25, 2013, 4:32:12 PM4/25/13
to php-form-bu...@googlegroups.com
Okay V3, fixed a few more bugs this code is much more robust again.

Added all Validation types except Captcha, which I doubt we want anyhow.  Also added a new Decimal Validation.

Still want to make a div to display error messages on the fly, but that will be the next revision.

Hope you guys enjoy it.
PFBC-JS-Validate.patch
Reply all
Reply to author
Forward
0 new messages