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.
You can check it via Input::get('submit_button_name');
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?
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....
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>
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' )) }}
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community