Just found that contour renders a form on a page with an empty action attribute which creates invalid Html, as far as I am aware the form works perfectly, I came across this article but most of it goes over my head.
I'm experiencing this too. I think it might have something to do with the fact that I am hijacking routes (or maybe because I created a custom global.asax.cs that inherits from UmbracoApplication and sets up Ninject IoC/DI). I'm thinking that whatever Contour does to register routes never happens, so any BeginForm that uses the controller/action of FormRender/ContourForm will not produce a valid route.
Seems like this would be a pretty common scenario, but I'm not sure how others have handled this. Maybe they register the route for Contour?
@Tim cool! Also if you are making Contour changes a small amendment is required in contour.js to stop it trying to submit every form on the page that has a submit button,
Contour generates empty action attribute
Just found that contour renders a form on a page with an empty action attribute which creates invalid Html, as far as I am aware the form works perfectly, I came across this article but most of it goes over my head.
http://www.jarredcapellman.com/2013/4/28/MVC4-Form-Action-Empty-when-using-Html.BeginForm
I'm experiencing this too. I think it might have something to do with the fact that I am hijacking routes (or maybe because I created a custom global.asax.cs that inherits from UmbracoApplication and sets up Ninject IoC/DI). I'm thinking that whatever Contour does to register routes never happens, so any BeginForm that uses the controller/action of FormRender/ContourForm will not produce a valid route.
Seems like this would be a pretty common scenario, but I'm not sure how others have handled this. Maybe they register the route for Contour?
Anybody tried this before?
Me three. Annoying since it means the sites do not pass the w3c validator.
I think this article could explain the issue further but it is going to require fixing in Contour
Comment author was deleted
@Jeavon awesome, I'll take a look :)
@Tim cool! Also if you are making Contour changes a small amendment is required in contour.js to stop it trying to submit every form on the page that has a submit button,
should be changed to
Comment author was deleted
ok thanks Jeavon taking a look today at this one :)
I know this is an old topic. But the empty action attribute is still there. I'm currently using Contour 3.0.18. Any chance this will be fixed Tim?
Comment author was deleted
Yeah taking a look now
Comment author was deleted
Or if you need a different action you can also set it setting to # or ? should also be valid
Comment author was deleted
Hmm previous post is gone so soluton is to update form view
@using (Html.BeginForm("ContourForm", "FormRender", FormMethod.Post, new { action=Request.ServerVariables["URL"] + "?" + Request.QueryString, enctype = "multipart/form-data" }))
Thanks Tim! This is working.
Concerning invalid HTML (what this issue was about) I've found another one, when using a checkboxlist:
"The for attribute of the label element must refer to a form control. …-9060-1e3f3b233fae" class="fieldLabel">Kies je eigen tijd </label>"
Comment author was deleted
ok should be easy to update on the checkbloxlist view
Comment author was deleted
hmm it already has that in place
Comment author was deleted
could it be that you made adjustments to the view?
Thanks for checking Tim. I did not change the view: FieldType.CheckBoxList.cshtml
This is what's in it (I also downloaded the latest version here and compared it using winmerge) http://our.umbraco.org/FileDownload?id=10426
@model Umbraco.Forms.Mvc.Models.FieldViewModel
<span class="checkboxlist" id="@Model.Id">
@foreach (Umbraco.Forms.Mvc.Models.PrevalueViewModel pv in Model.PreValues)
{
}
</span>
and this is what the validator says: http://validator.w3.org/check?uri=http%3A%2F%2Fwww.breienhaakvierdaagse.nl%2F&charset=%28detect+automatically%29&doctype=Inline&group=0#result
Any clue Tim? Or did I make a mistake somehow?
is working on a reply...