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.
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?
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.
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.
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.
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!
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!
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 theforms.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?
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
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.
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!
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
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
Hi Mads,
A couple of fixes for using Contour Razor we've made which might help you:
In contour.js
And also the fix for unobtrusive.js at the bottom of this post
Jeavon
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
Mind sending a link to the form?
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
Thanks Iulia
Comment author was deleted
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!
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...
:)
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!
is working on a reply...