Welcome Guest, Not a member yet? Register   Sign In
redirect back withInput requries session otherwise old() empty
#3

(This post was last modified: 10-11-2018, 05:54 AM by happyape.)

(10-11-2018, 01:23 AM)Pertti Wrote: Is the form and validation in same controller method? In which case you could end up in endless loop - validation fails, same POST data is sent back, so it'll try to re-validate, repeat...

I keep form and validation on same method, so if input fails validation, it just continues with putting together HTML form, but knows to now insert errors too.

Yes they are in the same method and it works well without any looping issues. As you can see, I go into validation IF(post data is not empty) i.e. on a POST request and redirect WithInput is a GET request - so no issues at all. The only issue is that I got to have a session() call at the top of this method to be able to read old input data using Old method.
Reply


Messages In This Thread
RE: redirect back withInput requries session otherwise old() empty - by happyape - 10-11-2018, 05:52 AM



Theme © iAndrew 2016 - Forum software by © MyBB