0
即使datefrom大於dateto,是否有任何簡單的方法可以禁用提交按鈕?並且它必須被禁止,直到形式是有效的,憑有效日期,datefrom必須小於dateto通過比較日期的表單驗證angularjs
<div class="form-group">
<div class="col-lg-4 col-md-4 col-sm-5 col-xs-5 col-lg-offset-1 col-md-offset-2 col-sm-offset-1">
<label class="control-label">Date from:</label>
<p class="input-group">
<input type="text" onkeypress='return event.charCode >= 44 && event.charCode <= 57' class="form-control" ng-model="recp.OdK" name="datefrom" id="datefrom" data-date-format="dd.MM.yyyy" bs-datepicker data-autoclose="1" required/>
<span class="input-group-btn">
<button type="button" class="btn btn-default" ng-click="Opened=true;$event.stopPropagation();">
<i class="glyphicon glyphicon-calendar"></i>
</button>
</span>
<p>
</div>
<div class="col-lg-4 col-md-4 col-sm-5 col-xs-5">
<label class="control-label">Date to:</label>
<p class="input-group">
<input type="text" onkeypress='return event.charCode >= 44 && event.charCode <= 57' class="form-control" ng-model="recp.DoK" name="dateto" id="dateto" data-date-format="dd.MM.yyyy" bs-datepicker data-autoclose="1" required/>
<span class="input-group-btn">
<button type="button" class="btn btn-default" ng-click="Opened1=true;$event.stopPropagation();">
<i class="glyphicon glyphicon-calendar"></i>
</button>
</span>
</p>
</div>
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1">
<button type="submit" ng-disabled="recpForm.$invalid" id="buto" class="btn btn-primary glyphicon glyphicon-ok prikButton" ng-click="precp();precpnp();precprb();recpss();"></button>
</div>