I am using Laravel 5.1, and I would like to create a form with two submit buttons - Save and save the draft.
But when I submit my form, I have all the fields except the submit value.
I read that Laravel will not put the value of the submit button in POST when the form was submitted via ajax, so that you can help me how to do this?
I tried the code as below:
{!! Form::open(['url' => 'offer/create', 'method' => 'post', 'id' => 'offer-create']) !!} .... here are my fields .... {!! Form::submit( 'Save', ['class' => 'btn btn-default', 'name' => 'save']) !!} {!! Form::submit( 'Save draft', ['class' => 'btn btn-default', 'name' => 'save-draft']) !!}
In my .php routes, I have:
Route::controller('offer', 'OfferController');
Thank you in advance
source share