[[!FormIt? &hooks=`spam,email` &emailTpl=`kontaktMail` &successMessage=`<span class="successMessage">Vielen Dank für Ihre Nachricht.</span>` &validationErrorMessage=`<span class="errorBlue_big">Bitte überprüfen Sie ihre Eingaben.</span>` &emailTo=`mailadress` &clearFieldsOnSuccess=`1` &validate=`nospam:blank, name:required, email:email:required, text:required:stripTags` ]] [[!+fi.validation_error_message:notempty=`<p>[[!+fi.validation_error_message]]</p><br>`]] [[!+fi.successMessage]]
[[!FormIt? &hooks=`spam,email,redirect` &redirectTo=`http://www.abc.ch#contact` &emailTpl=`kontaktMail` &successMessage=`<span class="successMessage">Vielen Dank für Ihre Nachricht.</span>` &validationErrorMessage=`<span class="errorBlue_big">Bitte überprüfen Sie ihre Eingaben.</span>` &emailTo=`email` &clearFieldsOnSuccess=`1` &validate=`nospam:blank, name:required, email:email:required, text:required:stripTags` ]] [[!+fi.validation_error_message:notempty=`<p>[[!+fi.validation_error_message]]</p><br>`]] [[!+fi.successMessage]]
I think it's because the redirect is made to redirect the user and show a success message or thank you page that you've prebuilt.
The successmessage method is usually used if you don't want to redirect the user but render out a thank you message on the same page as the form.
The form should clear once you've hit submit so pressing ctrl + r won't do anything and if there is a risk of submitting data again your browser will usually prompt you about resubmitting.
However, it sounds like you just need to put your thank you message into the content of your redirected resource if that's the approach you wanted to take.
"action="[[~[[*id]]]]#myid"
you could set special redirectParams. If set, show the successmessage
[[!FormIt? &hooks=`spam,email,redirect` &redirectTo=`[[~[[*id]]]]#contact` &emailTpl=`kontaktMail` &validationErrorMessage=`<span class="errorBlue_big">Bitte überprüfen Sie ihre Eingaben.</span>` &emailTo=`email` &clearFieldsOnSuccess=`1` &validate=`nospam:blank, name:required, email:email:required, text:required:stripTags` &redirectParams=`{"success":"1"}` ]] [[!+fi.validation_error_message:notempty=`<p>[[!+fi.validation_error_message]]</p><br>`]] [[!#get.success:is=`1`:then=` <span class="successMessage">Vielen Dank für Ihre Nachricht.</span> `:else=``]]
if you have fastFields or pdoTools installed, you can use fastField - tags to get the url-query-params, like so (untested!):
[[!FormIt? &hooks=`spam,email,redirect` &redirectTo=`[[~[[*id]]]]#contact` &emailTpl=`kontaktMail` &validationErrorMessage=`<span class="errorBlue_big">Bitte überprüfen Sie ihre Eingaben.</span>` &emailTo=`email` &clearFieldsOnSuccess=`1` &validate=`nospam:blank, name:required, email:email:required, text:required:stripTags` &redirectParams=`{"success":"1"}` ]] [[!+fi.validation_error_message:notempty=`<p>[[!+fi.validation_error_message]]</p> `]] [[!#get.success:is=`1`:then=` <span class="successMessage">Vielen Dank für Ihre Nachricht.</span> `:else=``]]