Submit Form Returns a View on Same Page in #target


Well-known member
What is the easiest build-in function to submit a form and still stay on the same page? Is there a function like this:
<div id="target">
  <form action="{xen:link pasta}" class="Unknown" data-target="#target"> </form>
function actionPasta { return Template 'pasta_list'}
[code is there to show the idea, not how it really works]

Chris D

XenForo developer
Staff member
A class of AutoValidator and an attribute of data-redirect="off" would submit the form without navigating away from that page. You can then use some javascript and AJAX magic to make things happen based on the data being submitted.

Of course the perfect example of how to do this is profile post comments. The data is submitted via a form, and the end result is rendered without reloading the page.