Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi there,
Is there away to override the form validation?
I would like to check if email is unique against the member list and return custom validation error if not.
Cheers
mkariti
You could use any custom js validation by binding to the input.
Thanks
Comment author was deleted
If you are using the razor macro there is an event you can hook into to add additional validation rules
Umbraco.Forms.Mvc.FormRenderController. FormValidate event
And if you are using the code first approach it should be even easier, check out these examples: http://www.nibble.be/?p=205 (Validate() method)
Alex, Tim,
Many thanks for your reply!
I'm actually after server validation rather than JQuery one (Which I've already implemented).
Tim, the Umbraco.Forms.Mvc.FormRenderController sounds good. Do you have by any chance available example?
I'm assuming that it will be using the Umbraco.Forms.Mvc.dll?
I can't get the event I'm after in the above dll.
Yup it's in that assembly
But correct namespace is
Umbraco.Forms.Mvc.Controllers.FormRenderController. FormValidate
Excellent!
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Override form validation in razor
Hi there,
Is there away to override the form validation?
I would like to check if email is unique against the member list and return custom validation error if not.
Cheers
mkariti
You could use any custom js validation by binding to the input.
Thanks
Comment author was deleted
If you are using the razor macro there is an event you can hook into to add additional validation rules
Umbraco.Forms.Mvc.FormRenderController. FormValidate event
And if you are using the code first approach it should be even easier, check out these examples: http://www.nibble.be/?p=205 (Validate() method)
Alex, Tim,
Many thanks for your reply!
I'm actually after server validation rather than JQuery one (Which I've already implemented).
Tim, the Umbraco.Forms.Mvc.FormRenderController sounds good. Do you have by any chance available example?
I'm assuming that it will be using the Umbraco.Forms.Mvc.dll?
I can't get the event I'm after in the above dll.
Cheers
mkariti
Comment author was deleted
Yup it's in that assembly
Comment author was deleted
But correct namespace is
Umbraco.Forms.Mvc.Controllers.FormRenderController. FormValidate
Excellent!
is working on a reply...