Copied to clipboard

Flag this post as spam?

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


  • Mads Jørgensen 74 posts 226 karma points
    Nov 05, 2013 @ 13:12
    Mads Jørgensen
    0

    Form cannot submit due to script errors

    Hey all, been fighting for half a decade now with Contour.

    Installed Contour as out of the box, latest and everything. Can generate forms to client side, but really cannot submit them.

    It all started with setDefaults() error. But googled me to the fact that it's because Contour uses loads of scripts by itself. I manually added these scripts to the forms.cshtml file within the plugins folder.

    This all solved the JS errors, sadly it doesn't make stuff submit anything.

    Now I get no errors, but Contour doesn't submit either :-(

    Facts:

    Umbraco 6.1.6 in MVC mode, but calling the macro via Macro Container datatype and Umbraco.library:RenderMacroContent() within an XSLT file.

    Any hints?

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Nov 05, 2013 @ 13:22
    Chriztian Steinmeier
    0

    Hi Mads,

    So you have a macro (X) that uses RenderMacroContent() to render the Contour form - macro X is then rendered through the MacroContainer? Apart from the obvious Inception references in my head, I think I can follow what's happening :-)

    • Do you get the expected HTML output - e.g., no self-closing elements or similar stuff that could break the DOM ?

    • "doesn't submit" as in you press the submit button, and nothing happens at all?

    • Have you tried adding a breakpoint in the contourForm.js file (it's far down in /plugins/umbracoContour/scripts/Frontend I think) in the handler that gets attached to input[type=submit] to see if you ever get there?

    /Chriztian

  • Mads Jørgensen 74 posts 226 karma points
    Nov 05, 2013 @ 13:26
    Mads Jørgensen
    0

    Yeah, that's sort of fucked, but still. It's a macro rendering some boxes, and one of these boxes has a Macro container where I pick the Contour macro.

    Strangely it's all about when the form submits, nothing happes. What I mean by that is, it refreshes the page, and submits all fine, just that I don't get the thankyou message and nothing is submitted to contour, just gets the form, with no errors afterwards.

  • Mads Jørgensen 74 posts 226 karma points
    Nov 05, 2013 @ 13:33
    Mads Jørgensen
    0

    I simply cannot submit stuff, but easily from form preview from brackoffice. Sort of in doubt I ever could submit stuff from Contour frontend wise!

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Nov 05, 2013 @ 13:37
    Chriztian Steinmeier
    0

    Hmm - sounds a lot like the behavior you get when you have nested (web)forms on a page...

    Have you tried the breakpoint thing? It sounds like the submit button submits another form (e.g. Search) ?

    /Chriztian

  • Mads Jørgensen 74 posts 226 karma points
    Nov 05, 2013 @ 13:53
    Mads Jørgensen
    0

    Nah, Filezilla says it's the right form submitting!

    But thanks anyways!

    Sort of getting to think it might be an install error or something, it's sort of crazy.

    /Mads

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Nov 05, 2013 @ 14:07
    Jeavon Leopold
    0

    Hi Mads,

    A couple of fixes for using Contour Razor we've made which might help you:

    In contour.js

    $('input[type=submit]').click(function (evt) {
    
    should be changed to  
    
    $('#contour input[type=submit]').click(function (evt) {
    

    And also the fix for unobtrusive.js at the bottom of this post

    Jeavon

  • Iulia Maria Jensen 40 posts 71 karma points
    Nov 05, 2013 @ 15:27
    Iulia Maria Jensen
    0

    Hi,

    The problem is that the form is actually getting posted but somehow not submitted. 

    I can see it in Network and I can see the data.

    I can also submit the form if I preview it and I can see that I get redirected to the desired page (in preview).

    However, I "cannot" submit the form on the actual page. It looks like it just reloads the same page instead of sending the info and redirecting to the selected page.

     

    Kind regards,

    Iulia who is a colleague of Mads :)

  • Comment author was deleted

    Nov 06, 2013 @ 08:40

    Mind sending a link to the form?

  • Iulia Maria Jensen 40 posts 71 karma points
    Nov 06, 2013 @ 08:56
    Iulia Maria Jensen
    0

    Hi Tim,

    I'm sending you an email with a link and we can continue there (in case you need a test user or something) since it's "sensitive" data and our client's website. We will definitely post the solution here when found though.

    Kind regards, Iulia

  • Comment author was deleted

    Nov 06, 2013 @ 09:08

    Thanks Iulia

  • Comment author was deleted

    Nov 06, 2013 @ 09:12

    So forms are outputted with xslt that is something I haven't seen before :) if you can also create me a backoffice user and send details that would be ace!

  • Iulia Maria Jensen 40 posts 71 karma points
    Nov 06, 2013 @ 09:41
    Iulia Maria Jensen
    0

    That would be because the Insert Contour form macro is used by the clients in the richtext editor, right?

    And the whole content of the richtext editor is rendered via XSLT...

    :)

  • Mads Jørgensen 74 posts 226 karma points
    Nov 06, 2013 @ 15:04
    Mads Jørgensen
    0

    So error found!

    What we did wrong was, that we called a macro @Umbraco.RenderMacro("Document") which handled rendering of fields and some logic in the document. One of these parts was to render <xsl:value-of select="umbraco.library:Item($currentPage/@id,'content')" />.

    This is NOT a great approach then!

    What we did now whas to move the rendering logic onto the view and then calling @Umbraco.Field("content") instead... Solved everything!

    Thanks very very much guys for all your input, that all together pointed us (ultimately Tim) in the right direction!

Please Sign in or register to post replies

Write your reply to:

Draft