当我点击textbox
时它正在工作,但我也希望它在icon click
上。
有人可以帮帮我吗?
我的源代码是: -
<div class="form-group col-lg-6">
<div class='input-group date'>
<asp:TextBox ID="txtfirstDeliverableDt" runat="server" Text="--please Select date--" CssClass="form-control deliverableTextbox date-picker" ></asp:TextBox>
<span class="input-group-addon" id="datetimepicker1">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
答案 0 :(得分:0)
这将是您的java脚本代码: -
$('.open-datetimepicker').click(function(event){
event.preventDefault();
$('#datetimepicker').click();
});
您的HTML代码如下: -
<div class="input-group">
<input type="text" id="datetimepicker" class="form-control" name="date">
<label class="input-group-addon btn" for="date">
<span class="fa fa-calendar open-datetimepicker"></span>
</label>