I'm currently updating to Contour 3 and having some problems. I haven't found any documentation about how to actually get a form to render from a razor file, so I might be going about it in the wrong way. If so, please correct me.
What I've done now is use a hack to render MvcRenderContourForm.cshtml as a macro to be able to pass the FormGuid parameter and it seems the form renders ok. However, client side validation does not work. So I added jquery.validate and jquery.validate.unobtrusive to my page template and now required field validation works, but regex validation for instance does not. When I click submit the form is submitted and then I see the validation error message. Am I missing something? How can I fix it?
Genius. Thank you! I had placed the script files at the bottom of the body. Moving them to the head fixed it. I'm still not satisfied with my rendering hack, but it'll do for now.
For rendering, if you upgrade you need a new macro that is hooked to the MvcRenderContourForm.cshtml script and add a single parameter called formguid of type formpicker, but sounds like that is how you did it :)
Contour 3 client side validation
Hello everyone.
I'm currently updating to Contour 3 and having some problems. I haven't found any documentation about how to actually get a form to render from a razor file, so I might be going about it in the wrong way. If so, please correct me.
What I've done now is use a hack to render MvcRenderContourForm.cshtml as a macro to be able to pass the FormGuid parameter and it seems the form renders ok. However, client side validation does not work. So I added jquery.validate and jquery.validate.unobtrusive to my page template and now required field validation works, but regex validation for instance does not. When I click submit the form is submitted and then I see the validation error message. Am I missing something? How can I fix it?
Cheers.
Comment author was deleted
Hey to get started you can use: http://umbraco.com/follow-us/blog-archive/2012/11/9/getting-started-with-contour-30-beta.aspx
Where did you place the script includes in the head of your page or somewhere else?
Genius. Thank you! I had placed the script files at the bottom of the body. Moving them to the head fixed it. I'm still not satisfied with my rendering hack, but it'll do for now.
Comment author was deleted
For rendering, if you upgrade you need a new macro that is hooked to the MvcRenderContourForm.cshtml script and add a single parameter called formguid of type formpicker, but sounds like that is how you did it :)
is working on a reply...