contao/test — Issue #1116: Improve forms after submit
Author: importer
Created: 2011-11-29 07:22:56+00:00
State: open
Labels: Feature

As we know user can set redirect page after submit form or no. When no after submit form user will return to the same page. That's OK.
But there is a little problem when we create site in "one page site" style. Where all content is on the page already only portioned via tabs or slides (javascript). Pages in this style are popular as a little portfolio or something like this. That's why redirecting to "Thank You" page is not good solution in this case. Of course I understand that implement static message after submit form is not good solution, too. Becouse message should have a content like "Thank you for sending form" (or something like this) but the true is that content of this message is depend on the form. For one form we need "Thank you" message for second "Your form is submited" and so on.
That's why I think there could be other solution: if we have a form and we have not set redirect page. So in this case is enough that system after submit will add to this specific form (or to div .formbody inside this form) additional class "submited". This class can be trigger for any js scripts (e.g. mootools, jquery) to show message (whatever we like) after submit this specific form. Even if we will have on one page more than one form it will still working becouse at once we can submit one form. Of course after reload page (F5) or any other action when page will reload the "submited" class will gone from this specific form. And when form return error (e.g. due to validation) will normal behavior like present is (with no class "submited").
I hope it's make sense.

--- _Originally created by qrczak on October 28th, 2009, at 08:43pm (ID 1116)_