laracasts / Validation

Easy form validation.
https://packagist.org/packages/laracasts/validation
MIT License
150 stars 37 forks source link

Incorrect behaviour #22

Open anandchavan opened 9 years ago

anandchavan commented 9 years ago

Steps -

Fields on my page {email, username, password, password_confirmation} & submit button

  1. I have added validation rules on Registration page
  2. Submitting form all correct entries but password confirmation
  3. Got appropriate error message
  4. from same page, removed all values
  5. submit page

Expected - Required fields validation should be displayed and all input fields should be empty as submitted.

Actual - Got correct messages, however username & password field is showing old values.

I even tried refreshing page, now error messages are not displayed but username&password is as is.

Please confirm the behavior. Thanks!

Regards, Anand Chavan

DevJMD commented 9 years ago

You might need to remove, presuming you're using the withInput() declaration:

From:

return Redirect::back()->withInput()->withErrors($e->getErrors());

To:

return Redirect::back()->withErrors($e->getErrors());

withInput() will carry the previous field entires post-submit and return them.