Support the ongoing development of Laravel.io →
posted 9 years ago
Forms
Last updated 1 year ago.
0

Your submitted button value will be within the inputs sent.

In your controller which handles the response tothe form try something like

dd(Input::all()) and look at the results, it should tell you which submit button was pressed.

Last updated 1 year ago.
0

You can check it via Input::get('submit_button_name');

Last updated 1 year ago.
0

matyhaty said:

Your submitted button value will be within the inputs sent.

In your controller which handles the response tothe form try something like

dd(Input::all()) and look at the results, it should tell you which submit button was pressed.

well i tried it, and it only show array of all my input but not my submit button... is it something to do with put method?

Last updated 1 year ago.
0

Stol3x said:

You can check it via Input::get('submit_button_name');

well since it's not returning value in input::all() array so check using that is useless....

Last updated 1 year ago.
0
Solution

okay i already find the solution, it appear that Laravel Form builder uses the input to generate the submit button which will not be submitted so the only solution is using this

<button type="submit" name="simpan" class="btn btn-primary" data-toggle ='tooltip' 
    data-placement='top' title ='Batal menambah artikel dan kembali ke halaman kelola artikel' value="simpan">Simpan</button>

<button type="submit" name="batal" class="btn btn-primary" data-toggle ='tooltip' 
    data-placement='top' title ='Menyimpan artikel' value="simpan">Batal</button>
Last updated 1 year ago.
0

just add name property to the Form builder.

{{ Form::submit('Simpan',array('name' => 'simpan', 'class' => 'btn btn-primary', 'data-toggle' => 'tooltip', 'data-placement' => 'top','title' => 'Menyimpan artikel' )) }}

Last updated 1 year ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

t0n1zz t0n1zz Joined 8 Oct 2014

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.