mardi 23 octobre 2018

can't save data when edit data with modal

why can't save data, when edit data?

index.blade.php

<td>
   <a href="" class="edit_real" data-toggle="modal" data-target="#edit_real-">
        
   </a>
      @include('reals._form')
/td>

form modal in blade

    <div class="modal fade" id="edit_real-" role="dialog" >
<div class="modal-dialog modal-sm-8">
    <div class="modal-content">
        <div class="nav-tabs-custom">
            <ul class="nav nav-tabs pull-left">
                <li class=""><a href="">Plan</a></li>
                <li class="active"><a href="">Real</a></li>
            </ul>

            <div class="tab-content">
                <div class="chart tab-pane active" id="revenue-chart">
                {!! Form::open([$spent_time, 'url' => route('real.update', $spent_time->id), 'method' => 'POST', 'role'=>'form']) !!}
                 

                <div class="box-body">
                <div class="form-group">
                    {!! Form::label('user_story','Today Plan *', ['class' => 'control-label', 'name'=>'user_story']) !!}</label>
                    {!! Form::text('user_story', old('plan_id', is_null($spent_time->plan->user_story) ? null : $spent_time->plan->user_story), ['class'=>'form-control', 'readonly' => 'true']) !!}                   
                </div>

                <div class="form-group">
                    {!! Form::label('daily_spent_time','Spent Time *', ['class' => 'control-label', 'name'=>'daily_spent_time']) !!}</label>
                    {!! Form::text('daily_spent_time', old('daily_spent_time', $spent_time->daily_spent_time ?: null), ['class'=>'form-control', 'id'=>'daily_spent_time']) !!}                   
                </div>

                <div class="form-group">
                    {!! Form::label('daily_percentage','% Done *', ['class' => 'control-label', 'name' => 'daily_percentage']) !!}</label>
                    {!! Form::text('daily_percentage', old('daily_percentage', $spent_time->daily_percentage ?: null), ['class'=>'form-control']) !!}
                </div>

                <div class="form-group">
                    {!! Form::label('reason','Reason', ['class' => 'control-label', 'name'=>'reason']) !!}</label>
                    {!! Form::textarea('reason', old('reason', $spent_time->reason ?: null), ['class'=>'form-control']) !!}  
                </div>

                <div class="form-group">
                    {!! Form::submit('Save', ['class' => 'btn btn-block btn-primary btn-flat']) !!}
                </div>
            </div>
        </div>
    </div>
</div>

this is script in form modal

<script>
// jquery
$('.edit_real').on('click', function (event) {
event.preventDefault();

$('#edit_real').modal();
});
</script>

the data is read when editing, but cannot save to a table like the one in the red line

enter image description here

cannot save to a table like the one in the red line

enter image description here

main point <td> <a href="" class="edit_real" data-toggle="modal" data-target="#edit_real-">
</a> @include('reals._form') </td>
where is the mistake?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire