0
我使用MVC與角JS和使用parsley.js(版本2.6.2)parsley.js條件形式驗證
驗證當我檢查checkbox1然後2文本框(txtCustomer,txtchk1 & txtchk2)應該被要求提交表單時
當checkbox2然後點擊文本框(txtCustomer & txtchk3)應要求
我的形式如下。
<input type="checkbox" id="chkCreditCard" ng-model="dvCreditCard" ng-change="alert1(dvCreditCard)" />
Check1 required
<input ng-model="" type="text" class="form-control" id="txtchk1" placeholder="requied if checkbox1 checked" />
<input ng-model="" type="text" class="form-control" id="txtchk2" placeholder="requied if checkbox1 checked" />
<input type="checkbox" id="chkCheque" ng-model="dvCheque" />
Check2 required
<input ng-model="" type="text" class="form-control" id="txtchk3" placeholder="requied if checkbox2 checked" />
</form>