CodeIgniter Forums

Full Version: Contact Form in different Pages
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum


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.

El Forum

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.