0
我們一般的div標籤做錯誤的驗證如下有反饋誤差不工作的自舉表上表單驗證在laravel
<div class="form-group has-feedback {{ $errors->has('Email') ? 'has-error' : '' }}" id="">
<label class="col-md-4 control-label "> Email</label>
<div class="col-md-4">
<input type="text" name="Email" class="form-control" >
@if ($errors->has('Email'))
<p class="help-block"><span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
{{ $errors->first('Email') }}</p>
@endif
</div>
</div>
這裏是我的表碼:
<table class="table table-bordered table-striped-col nomargin" id="table-data">
<tr align="center">
<td>Event Name</td>
<td>Event Code</td>
<td>Event Date</td>
<td>City</td>
<td>Country</td>
</tr>
<tr>
<td>
<div class="form-group has-feedback {{ $errors->has('eventname') ? 'has-error' : '' }}">
<input type="text" class="form-control" autocomplete="off" name="eventname[]" >
@if ($errors->has('eventname'))
<p class="help-block"><span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
{{ $errors->first('eventname') }}</p>
@endif
</div>
</td>
<td>
<input type="text" class="form-control" autocomplete="off" name="eventcode[]" >
</td>
<td>
<input type="text" class="form-control dob" autocomplete="off" name="date[]" >
</td>
<td>
<input type="text" class="form-control" autocomplete="off" name="city[]" >
</td>
<td>
<input type="text" class="form-control" autocomplete="off" name="country[]" >
</td>
<td>
<input type="button" value="+" class="add btn btn-success">
<input type="button" value="-" class="delete btn btn-danger">
</td>
</tr>
</table>
同樣使用在表上的數組輸入以及但它不工作荷蘭國際集團
<table>
<tr>
<td class="form-group has-feedback {{ $errors->has('eventname') ? 'has-error' : '' }}">
<input type="text" class="form-control " autocomplete="off" name="eventname[]" >
@if ($errors->has('eventname'))
<p class="help-block"><span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
{{ $errors->first('eventname') }}</p>
@endif
</td>
</tr>
</table>
我已經嘗試了方法,但它不工作..Please建議我如何使用上舉表此驗證?
耶你的答案是正確的。但我們如何給數組輸入相同? – 06011991
其中是你的代碼中的數組?你怎麼把它放在你的桌子裏面? –
我編輯了我的問題。如果我使用foreach循環,它可以工作嗎?您可以在表 – 06011991