Welcome Guest, Not a member yet? Register   Sign In
Preserve Post
#1

[eluser]JREAM[/eluser]
I saw this someplace but can't find it, I've been digging around the docs!

When you submit a form, and the page reloads,
How do you keep the previous POST data in the field?
#2

[eluser]Colin Williams[/eluser]
Store it in the session. Or if you mean repopulated form fields, CI has a set_value() function for that.
#3

[eluser]Dyllon[/eluser]
I may be mistaken but I believe JREAM is asking how to repopulate the form, if this is the case check the set_value function in the form helper.
http://ellislab.com/codeigniter/user-gui...elper.html
#4

[eluser]JREAM[/eluser]
Okay set_value() might be it.

I might just do set_value() inside the controller via a Session, and unset it if it goes well.
#5

[eluser]Colin Williams[/eluser]
If you need to maintain the POST data across an HTTP redirect, then use Session to preserve the data. Otherwise, forget I mentioned anything about sessions
#6

[eluser]JREAM[/eluser]
Okay thanks, then Ill do it withuot sessions and see how she works Tongue




Theme © iAndrew 2016 - Forum software by © MyBB