I'm using laravel application and using modal form for edit.
When I use label as "title","des" and in modal "my-title" & "my-description" in two fields, it gets all the data but on the third field when I use any text such as "value" & "my-value" it doesn't get the data.
Also please help how to get data in dropdown menu.
In this you can see data for phase total area and town is not getting in required fields.
Index.blade.php
@foreach($phases as $cat)
<tr>
<td>{{$cat->phase_name}}</td>
<td>{{$cat->phase_address}}</td>
<td>{{$cat->phase_totalarea}}</td>
<td>
{{ \Illuminate\Support\Facades\DB::table('towns')->where('id',$cat->town_id)->value('town_name')}}</td>
<td>
<button class="btn btn-info"
data-mytitle="{{$cat->phase_name}}"
data-mydescription="{{$cat->phase_address}}"
data-myvalue="{{$cat->phase_totalarea}}"
data-mytown="{{$cat->town_id}}"
data-catid={{$cat->id}} data-toggle="modal"
data-target="#edit">Edit</button>
/
<button class="btn btn-danger" data-catid={{$cat->id}} data-toggle="modal" data-target="#delete">Delete</button>
</td>
</tr>
@endforeach
Form.blade.php
<label for="title">Phase Name</label>
<input type="text" class="form-control" name="phase_name" id="title">
</div>
<div class="form-group">
<label for="des">Phase Address</label>
<textarea name="phase_address" id="des" cols="20" rows="5" class="form-control"></textarea>
</div>
<div class="form-group">
<label for="value">Phase Total Area</label>
<input type="text" class="form-control " name="phase_totalarea" id="value" >
</div>
@php
use Illuminate\Support\Facades\DB;
$twn=DB::table('towns')->get();
$counter=0;
@endphp
<div class="form-group row">
<label for="town" class="col-md-4 col-form-label">Select Town:</label>
<div class="col-md-4 col-form-label">
<select name="town_id" class="form-control" style="width:360px" id="town" required autofocus>
<option value="">--- Select Town ---</option>
@foreach($twn as $town)
@if($counter==-1)
<option selected="selected" value="{{$town->id}}">{{$town->town_name}}</option>
{{$counter++}}
@else
<option value="{{$town->id}}">{{$town->town_name}}</option>
@endif
@endforeach
</select>
</div>
</div>