I’ve got a comment form on my page (commentlist) and want validate this. The form submits to another url: comment/add. The validation itself works perfectly but I can’t display the messages with form_errors(form) into the form field.
I know this is because the validation exists out of 2 pages. So it’s being validated but then redirected again to the page so that it looks like there are no mistakes.
my question:
What’s the best way to transfer the messages to my formpage so that I can show them to the user? Preferabbly to keep the submitted message.
You can use the flash messages. You can set the message into the action:
and you can show it into the template: