Submit Form Returns a View on Same Page in #target

Marcus

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:
PHP:
<div id="target">
  <form action="{xen:link pasta}" class="Unknown" data-target="#target"> </form>
</div>

PHP:
function actionPasta { return Template 'pasta_list'}
[code is there to show the idea, not how it really works]
 
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.
 
Back
Top Bottom