Support the ongoing development of Laravel.io →
Requests Input Validation
Last updated 2 years ago.
0

Can you post your store method from the controller and a snippet of one of the fields that doesn't get filled out?

0

I don't have any experience with FormRequests, but I had the same issue recently.

Check that you don't have a 301 redirect (Laravel does this if you have a trailing slash on the form action URL, and sends you to the non-slashed version) as by the time the request has redirected, the Flash message will have gone.

This tripped me up a few weeks ago - I eventually spotted it by looking in the JS console and spotting the 301 redirect message in the Network panel.

Caveat: at least I think this was what was happening!

Last updated 9 years ago.
0

tkprocat said:

Can you post your store method from the controller and a snippet of one of the fields that doesn't get filled out?

I have nothing in the store method. I Have another function which saves the form input in db using model->save() http://pastebin.com/RaFQ0nud (mycontroler)

In the view actually nothing get filled out. here is one of that field

<div class="form-group required"> <label for="address" class="col-sm-2 control-label" >Address</label> <div class="col-sm-5"> <textarea class="form-control" rows="2" id="address" name="address" placeholder="Your Address"></textarea> </div> </div>

DO i have to something in store() function?

Last updated 9 years ago.
0

davestewart said:

I don't have any experience with FormRequests, but I had the same issue recently.

Check that you don't have a 301 redirect (Laravel does this if you have a trailing slash on the form action URL, and sends you to the non-slashed version) as by the time the request has redirected, the Flash message will have gone.

This tripped me up a few weeks ago - I eventually spotted it by looking in the JS console and spotting the 301 redirect message in the Network panel.

Caveat: at least I think this was what was happening!

In my case the server replies with error code 302.

form action url : method="post" action="{{ url('/request-a-repair')}}"

0

Laravel doesn't fill out form fields automatically. You'll need to either use a package for building forms (like illuminate/html, or laravelcollective/html), or fill in form values with old() method:

<textarea class="form-control" rows="2" id="address" name="address" placeholder="Your Address">{{old('address')}}</textarea>
<input name="example" value="{{old('example')}}" />
0

Xum said:

Laravel doesn't fill out form fields automatically. You'll need to either use a package for building forms (like illuminate/html, or laravelcollective/html), or fill in form values with old() method:

<textarea class="form-control" rows="2" id="address" name="address" placeholder="Your Address">{{old('address')}}</textarea>
<input name="example" value="{{old('example')}}" />

I added that value parameter value= "{{old('example'}}" but the value comes to be empty when i see the source page of the view. Why is it empty? something to do with redirection?. I get server status 302 error.

0

In my case the server replies with error code 302.

That's probably what I meant :)

form action url : method="post" action="{{ url('/request-a-repair')}}"

Looks like this won't be your issue then. Good luck in working it out

0

Thanks! This post was very helpful, I didn't know we have helpers like old('field_value') to us. That's perfect. =) Good week to everybody, cheers!

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.