Html 使用引导扩展datepicker以从下拉列表开始
我有一个要求显示Datepicker与下拉作为一个单一的控制,我已经尝试了许多样品可在互联网上,但他们不适合我 下面给出了我的基本代码以及我必须合并它们的样式Html 使用引导扩展datepicker以从下拉列表开始,html,css,angularjs,twitter-bootstrap,Html,Css,Angularjs,Twitter Bootstrap,我有一个要求显示Datepicker与下拉作为一个单一的控制,我已经尝试了许多样品可在互联网上,但他们不适合我 下面给出了我的基本代码以及我必须合并它们的样式 <fieldset> <div class="form-group"> <label class="col-sm-2 control-label">Date</label> <div class="col-sm-4">
<fieldset>
<div class="form-group">
<label class="col-sm-2 control-label">Date</label>
<div class="col-sm-4">
<select name="Year" class="form-control" ng-model="Year" required>
<option>2016</option>
<option>2015</option>
<option>2014</option>
</select>
<div ng-messages="form.formValidate.select.$error" ng-if="form.formValidate.$submitted" class="text-danger"><span ng-message="required">This field is required</span></div>
<div class="ui-datepicker shadow-clear">
<p class="input-group">
<input type="text" name="date" required="" class="form-control" />
<span class="input-group-btn">
<button type="button" class="btn btn-default"><em class="ion-calendar"></em></button>
</span>
</p>
<div ng-messages="form.formValidate.date.$error" ng-if="form.formValidate.$submitted" class="text-danger"><span ng-message="required">This field is required</span></div>
</div>
</div>
</div>
</fieldset>
日期
2016
2015
2014
此字段必填
此字段必填
任何形式的帮助都将不胜感激
提前谢谢
编辑
哎呀!我没有提到两个控件应该并排,如下图所示
Edit2
我使用class=“form inline”将元素包装在一个div中,并使用class=“form group”将每组元素放入一个div中。我用叉子叉了你的靴子
日期
2016
2015
2014
此字段必填
此字段必填
您能安装一个plunker吗?如果你这样做的话,帮助你会更容易。谢谢。@jbrown链接已添加。。它们不是并排出现在那里的。好的,我来看看。它们应该是内联的,如图所示,例如。它们在一行中,但我现在看到您想要内联。这里有一个新的fork,我不确定我是否已经得到了您想要的东西,但也许有一个替代class=“input group”的方法可以让事情变得更紧张。检查表单InlineHank下的引导CSS文档,谢谢,但解决方案不符合我的要求,我希望将它们合并,使它们看起来像单个控件。好的。我想用这个细节重申你的问题,因为作为一个控件出现不同于你问题中所述的单行或内联。
<fieldset>
<div class="form-inline">
<div class="form-group">
<label for="Year">Date</label>
<select name="Year" class="form-control" required="" ng-model="Year">
<option>2016</option>
<option>2015</option>
<option>2014</option>
</select>
<div class="text-danger" ng-if="form.formValidate.$submitted" ng-messages="form.formValidate.select.$error"><span ng-message="required">This field is required</span></div>
</div>
<div class="form-group">
<div class="ui-datepicker shadow-clear">
<div class="input-group">
<input name="date" class="form-control" required="" type="text">
<span class="input-group-btn">
<button class="btn btn-default" type="button"><em class="glyphicon glyphicon-calendar"></em></button>
</span>
</div>
<div class="text-danger" ng-if="form.formValidate.$submitted" ng-messages="form.formValidate.date.$error"><span ng-message="required">This field is required</span></div>
</div>
</div>