1
我有一個視圖模型,我試圖添加驗證來使用敲除驗證。 嵌套數據結構中的敲除驗證
<table data-bind='visible: slots().length > 0'>
<thead>
<tr>
<th>Start Time</th>
<th>End Time</th>
</tr>
</thead>
<tbody data-bind='foreach: slots'>
<tr>
<td><input type="text" class="input-medium time-picker" data-bind='value: start_time' required="true"/></td>
<td><input type="text" class="input-medium time-picker" data-bind='value: end_time' required="true"/></td>
<td><a href='#' data-bind='click: $root.removeSlot'><i class="icon-minus-sign"/></a></td>
</tr>
</tbody>
</table>
<button class="btn btn-primary" data-bind='click: addSlot'>Add Row</button>
我需要驗證,如果我在第1行中輸入「END_TIME」當我比排START_TIME添加新行2必須比END_TIME行1