1

Update: The project has been started that should amend most, if not all, the problems UmbracoForms have (including AJAX calls). The discussion started on this forum thread: our.umbraco.org/forum/umbraco-7/developing-umbraco-7-packages/69933-replacing-contour-umbraco-forms-with-something-better. The website for the solution is: www.formulate.rocks and expected release date is 'early 2016' as stated on their website.

Original post:

I am trying to make an Ajax call with new UmbracoForms, but so far without success. The issue I am experiencing is described in the following OUR Umbraco forum post.

The problem is related with the modification of custom 'Form.cshtml'. Current implementation uses the following HTML helper:

@using (Html.BeginUmbracoForm<Umbraco.Forms.Web.Controllers.UmbracoFormsController>("HandleForm"))

This causes a post back to the page, which is a problem since the form on the website is being displayed in modal/overlay window.

I have tried the following two implementations:

First:

@using (Ajax.BeginForm("UmbracoForms", "HandleForm", new AjaxOptions 
                                                     {
                                                      HttpMethod = "POST",
                                                      OnSuccess = "Success()",
                                                      OnFailure = "Failure()"
                                                     }))

Second:

@using (Html.BeginForm("HandleForm", "UmbracoForms", FormMethod.Post, new { enctype = "multipart/form-data", role = "form" }))

There is additional information on the Umbraco forum page I have referenced, and also there is my comment at the bottom of the post with the described issue.

Marko Jovanov
  • 418
  • 10
  • 25
  • 1
    One of the solutions was proposed by [Nicholas Westby](https://our.umbraco.org/member/8882): [link to comment](https://our.umbraco.org/forum/umbraco-pro/contour/60788-Umbraco-Forms-and-Ajax#comment-233528). I will experiment with this a little bit and post the answer here if it was successful or not. This seems to be a rather persistent problem that hasn't been resolved yet. – Marko Jovanov Nov 17 '15 at 09:17
  • Also, a [post](https://our.umbraco.org/forum/umbraco-7/developing-umbraco-7-packages/69933-replacing-contour-umbraco-forms-with-something-better) outlining all the problems with _UmbracoForms_, if anyone decides to take this road. – Marko Jovanov Nov 17 '15 at 09:52
  • FYI, Formulate is now released and supports AJAX calls by default: http://www.formulate.rocks/ – Nicholas Westby Apr 11 '16 at 19:40
  • @NicholasWestby thank you for the info! I will give it a spin. – Marko Jovanov Apr 13 '16 at 12:43

0 Answers0