Jump to content

Handling form validation and maintaining form values...


hal10001

Recommended Posts

The topic is very similar to this post, but a little different:

 

http://www.phpfreaks.com/forums/index.php/topic,183392.0.html

 

I want to follow an MVC design pattern, with a view and controller. The view passes form values to the controller, and then the controller validates the input. In the case where there is an error, I need to redirect back to the view, keeping the values that were initially entered by the user. I know how to do this by appending query string variables to the return URL, but I have a ton of form data, with textarea fields, etc., and I need to know what is an alternative for sending this information back to the view. How do frameworks typically do this sorta thing -- is it by adding the values and errors to a session before redirecting? Someone suggested to me on another message board to use cURL and request the original view from the controller, render it, and fill in the form values that were submitted. That sounds like overkill, so I wanted to ask here. Thanks!!!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.