<section class="col col-4">
<label>Min Stock Level</label>
<label class="input">
<input type="text" name="minStock" min="0" ng-model="item.MinStockLevel" ng-pattern="/^[0-9]+(\.[0-9]{1,6})?$/" required />
<span ng-show="myForm.minStock.$dirty && myForm.minStock.$invalid">
<span style="color:green" ng-show="myForm.minStock.$error.required">Price is Required</span>
<span style="color: red" ng-show="myForm.minStock.$error.pattern">Not Valid</span>
</span>
</label>
</section>
这是输入最小值的第一个文本框。
<section class="col col-4">
<label>Max Stock Level</label>
<label class="input">
<input type="text" name="maxStock" ng- model="item.MaxStockLevel" min=" {{ item.MinStockLevel + 1 }}" ng-pattern="/^[0-9]+(\.[0-9]{1,6})?$/" required />
<span ng-show=" myform.maxstock.$dirty && myform.maxstock.$invalid">
<span style="color:green" ng-show="myForm.maxStock.$error.required">Price is Required</span>
<span style="color: red" ng-show="myForm.maxStock.$error.pattern">Not Valid</span>
</span>
</label>
</section>
它是第二个输入框。我想区分两箱最小库存水平和最大库存水平值。用户可以输入最大值,然后输入最小值,最小值小于最大值。我怎么验证呢?
答案 0 :(得分:0)
似乎问题是输入类型=“文本”,它应该是输入类型=“数字”,因为最小值和最大值适用于数字,而不是文本。