Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi just wondering is there any more recent solutions of getting umbraco forms to post with ajax so the page doesnt refresh and maintain page position?
There are 2 different ways, that I've seen, to achieve this.
The full AJAX way -> If you are using JQuery (or a-n-other type of JS library with ajax/async posting abilities) you could hook into the press of the submit button, cancel the default behavour, manually serialise the form. and submit it via an AJAX call. However, there is quite alot of manual behaviours you need to consider when doing this, such as error handling, response types etc.
The other approach, and one I've used on v7 and v8 sites, is to take advantages of Unobtrusive Ajax, stuff from MVC concepts. Paul Seal has a great video/blog about it here: https://codeshare.co.uk/blog/how-to-change-a-form-in-mvc-to-submit-with-ajax/. One thing to note, in this blog, Paul uses the Ajax.BeginForm helper, but you can manually add the same data attributes to a Html.BeginUmbracoForm approach (which personally I think is better).
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted