Return button to form with its values laravel

0

I have not found anything on interenet or if I do not apply it I have a form which has many "select" fields. The form is sent, and the result page has a button to return to the form page. Well, the issue is that I would like that once you click on the back button, the fields of the form were with the values with which it was sent. I have tried everything, but either I do not use it or I do not know. This of the Old input, I had never used it until now.

Thanks in advance !!

    
asked by Luis Ve 03.01.2018 в 02:11
source

1 answer

0

This you can put in the part of your controller where you indicate that the information was sent correctly;

return redirect()->back() //regresamos al mismo sitio del formulario
                 ->withInput($request->all()); //acá retornas toda la info enviada

It is not necessary that you add javascript or any other external thing.

Documentation: link (applies to > = 5 versions)

Try to do your searches in English so that you get more and better examples.

    
answered by 03.01.2018 в 07:13