-2

How can I make input modal box or another way by Laravel Blade?

My goal is that if I click to insert new list item in the list, then modal input box show.

<div class="form-group col-sm-4 col-lg-4">
   {!! Form::label('job_type', 'Type:') !!} 
   {!! Form::select('job_type', [
            '1' => '1',
            '2' => '2',
            '3' => '3',
            '4' => '4',
            '5' => '5',
            '6' => 'Add more item'            
     ], null, ['class' => 'form-control']) !!}
    </div>

enter image description here

JsWizard
  • 1,663
  • 3
  • 21
  • 48
  • add some javascript that listens for changes on your select, when it equals to the value of `Add more item` (https://stackoverflow.com/a/12750327/2276383) then open the modal using javascript too (`$("#myModal").modal("show");`) – H H Feb 15 '18 at 14:49

1 Answers1

0

try this js code :

$('#job_type').on('change', function (e) {
    if (6 == this.value) {
        $("#myModal").modal("show");
    }
});
BGH
  • 56
  • 1
  • 6