Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Feitern 6 posts 56 karma points
    Nov 27, 2012 @ 10:03
    Feitern
    0

    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

    Nov 27, 2012 @ 10:05

    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?

  • Feitern 6 posts 56 karma points
    Nov 27, 2012 @ 10:12
    Feitern
    0

    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

    Nov 27, 2012 @ 10:15

    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 :)

Please Sign in or register to post replies

Write your reply to:

Draft