nicovillas's avatar

How to create a modal window by executing an action on approval

Hello everyone, I have little experience with the generation of modal and I want to learn in the best way, in fact, I generated a modal window with the ready and cancel button but I cannot perform the action on my controller. It is possible that by pressing the ready button I can upload my file to my controller. I will add my code.

@if (Auth::user()->hasPermissions(['full-edit'], false))
			    <tr>
				<th>Aprobación documento</th>
				<td><form class="form-inline" enctype="multipart/form-data"  role="form" method="POST" action="{{url('contratos/contrato')}}/{{$entidad->id}}">
  <input type="hidden" name="_token" value="{{ csrf_token() }}" />
  <input type="hidden" name="model" value="bpt:hilti" />
  <label class="btn btn-default" for="file">
    <input id="file" name="file" type="file" style="display:none;" onchange="$('#upload-file-info').html($(this).val());">
      Seleccionar archivo ...
  </label>
  <span class='label label-info' id="upload-file-info"></span>
  <button type="submit" class="btn btn-success">Aprobación de acuerdo {{$entidad->nombre}}</button>
</form></td>
				    </tr>
				   @endif

This functionality is to load the file selected by the user to the controller that is in the path {{url ('contracts / contract'}} / {{$ entity-> id}} I need the modal window to be able to warn the user if is that you want to load the selected file to the controller

0 likes
1 reply
nicovillas's avatar

The order would be to select a file then press Approval of agreement and the modal window will open asking if you want to load said file and once the ready button is selected it will load the file to the controller

Please or to participate in this conversation.