Hello all, I am trying to build an Umbraco contour form that has the following fields in it:
Email and Confirm Email address. I want to run some validation to ensure that both fields match, otherwise I want to throw a client side & server side validation errors on this.
Has anyone done this before and if so, how have you achieved it?
How do I validate with a confirm email field?
Hello all,
I am trying to build an Umbraco contour form that has the following fields in it:
Email and Confirm Email address. I want to run some validation to ensure that both fields match, otherwise I want to throw a client side & server side validation errors on this.
Has anyone done this before and if so, how have you achieved it?
Cheers,
Warren :)
Client-side as follows:
Server-side:
Are you using razor?
Comment author was deleted
Easiest to do with code first: http://www.nibble.be/?p=205
If you don't have a code first form you can still hook into the server side validation there is an event available
Umbraco.Forms.Mvc.Controllers.FormRenderController FormValidate
Hey Tim,
We are not using CodeFirst as the client will be creating many more forms so can't go down that road unfortunately.
So with the event do I just hook into it the FormValidate event in a class?
Also will it fire for all forms or just a specific form?
Cheers,
Warren :)
Comment author was deleted
Fires for all forms
is working on a reply...