Processing a form located in a common view file... |
[eluser]EBS Promo[/eluser]
I have a form that is in it's own view (global footer). The form is submitted to whatever page/controller it is displayed in. What I did to make this work was puting all the logic in a helper file that holds a single function to validate the input and return a string variable for displaying in the view. Now doing it this way I have to load the helper, get the status, then pass that onto the footer view, all while keeping them in the same place. Has anyone else figured out a better way to do this (not using AJAX)? I know I can make a controller to handle the processing, but I would prefer to keep them on the same page the form was submitted from. I just am not sure if my solution is the most efficient to achieve the desired end result. I Googled the $&%@ out of every term I could imagine to see if anyone else has discussed a similar issue before and didn't have any luck.
[eluser]treeface[/eluser]
Hi EBS, Could you perhaps post your code here? That'd help me (and undoubtedly others) get my mind around what you're trying to do.
[eluser]EBS Promo[/eluser]
Here it is, I stripped out a lot of extra fields in the form and helper to simplify this example... Controller: Code: class Home extends Controller { Code: function appointment_form() { Code: <?=$appointment_form_status?> Code: </div> |
Welcome Guest, Not a member yet? Register Sign In |