CodeIgniter Forums
Contact Form in different Pages - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Contact Form in different Pages (/thread-58465.html)



Contact Form in different Pages - El Forum - 06-13-2013

[eluser]axelf[/eluser]
Hi,

I want to include the Contact Form with a partial view on different Pages of my Website. How can i validate this Form in One Central Place and the error Messages only One Time ? I don't want to Write the validation in every Controller were i want to show the Form.


Contact Form in different Pages - El Forum - 06-28-2013

[eluser]niki_mihaylov[/eluser]
Hey,
make a partial view file with the form and include it where you need it. Then you can:
1) use ajax (most friendly solution)
2) Set the action="" attribute of the form to one controller where you will validate and you can redirect back to previous page or show message on that page. Also you can store error message in session flash_data if you like.