【问题标题】:angularjs how to work validation on date . when I use date pickersangularjs 如何在日期上进行验证。当我使用日期选择器时
【发布时间】:2017-08-11 08:45:38
【问题描述】:

我不知道如何设置“预定日期”字段为必填项。当它按要求设置时,我没有得到数据。如果有人知道,请帮忙。验证不起作用。

查看:

<div class="form-group">
  <label for="inputEmail1" class="col-lg-2 col-sm-2 control-label">Scheduled Date</label>
  <div class="col-md-4" id="dt">
    <input class="form-control form-control-inline input-medium default-date-picker" name="date" ng-model="set_date" type="text" required/>
  </div>
  <div ng-messages="myForm.date.$error" style="color:maroon">
    <p ng-message="required"><i class="fa fa-exclamation-circle"></i> No.of Trucks required.</p>
  </div>
</div>

<div class="form-group">
  <div class="col-lg-offset-3 col-lg-10">
    <button type="submit" ng-click="post_load()" class="btn btn-primary">Submit</button>
  </div>
</div>

【问题讨论】:

标签: jquery angularjs validation datepicker bootstrap-datepicker


【解决方案1】:

你必须使用角度验证方式,将required更改为ng-required="true"

【讨论】:

  • 怎么可能。我没有得到数据
猜你喜欢
  • 2016-04-15
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-01-29
  • 1970-01-01
相关资源
最近更新 更多