One of the downfalls of the current cfform implementation of validation is that it only does it on the client side (as far as I have used it, it might have changed). So, you design your form, add some client side validation, then realise that people without javascript enabled are sending junk and you have to re-implement the validation server side.
So far so good. But then you are asked to change the validation (“hey, check it really is a creditcard number before we send it to the payment gateway”, your boss says) and you implement that on the server side, and then copy the functionality to the client side. The list of changes go on, you go make a cup of coffee and forget to implement one side of the validation somewhere.
With EventValidation, you define your validations in one place and you just define whether you are using client side validation. Lets check it out.
Here is our modified form from before, and you notice, there is only one change, adding client=”true” to the ev:setup tag (and make sure you import the form tags from “/EventValidator/taglib/form” as well as the showerror=”true”):
Register
</code>
Now you are all sorted and can see it working.
Tweet
comments powered by Disqus