vendredi 23 février 2018

Recover ID from Laravel UPDATE form

I need to record an ID from UPDATE form. After that, i would to use the variable into a condition @if.

FORM UPDATE:

<!-- FORM per aggiornare eventi -->
{!!Form::open(['route'=>['events.update',1],  'method'=>'PUT', 'id'=>'updatemodal'])!!}
  <div class="form-group">
     {!! Form::label('tipologia_evento_id', 'Tipo evento') !!}
     <select id="tipologia_evento_id" name="tipologia_evento_id" class="form-control" disabled>
         @foreach(DB::table('tipologie_eventi')->get() as $tipologia)
             <option
                @if(old('_tipologia_evento_id') == $tipologia->id)
                   selected="selected"
                @endif
                    value=""></option>
         @endforeach
     </select>
  </div>
  @if(!in_array(old('_tipologia_evento_id'),array(1,2)))
     <div class="modal-footer">
         <meta name="csrf-token" content="">
         <a id="delete" data-href="" data-id="" class="btn btn-danger">Elimina</a>
         <button id="aggiornaBtn" type="submit" class="btn btn-success" disabled="disabled">Aggiorna</button>
     </div>
  @endif
{!! Form::close() !!}

I tried to use @if(!in_array(old('_tipologia_evento_id'),array(1,2))) but not work good.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2Cg62s0
via IFTTT

Aucun commentaire:

Enregistrer un commentaire