Welcome Guest, Not a member yet? Register   Sign In
Multiple Forms different validation_errors()
#1

[eluser]Unknown[/eluser]
Hello,

how can i get differnt validation_errors() on a page with multiple forms? For example i have a login form on every page and an contactformular on one page. If the user forgot the subject in the contactform the error message appear above both forms.

validation_errors()

Thank you!
#2

[eluser]Pert[/eluser]
For each form, set a different controller or controller method as corresponding action.

In your example, I would expect login page to show me errors on dedicated login page, similar to when you are trying to log into Facebook, if password is wrong, you end on a page that has login form and not much else on it.

You can always capture "referral" either from _SERVER variable or dynamically set it as hidden variable and return to said page after successful login.




Theme © iAndrew 2016 - Forum software by © MyBB