如何使用Datepicker更改日期时删除类?

时间:2015-02-05 03:25:11

标签: javascript jquery html css datepicker

我想问一下当用户从Datepicker

中选择日期时如何删除课程
$('#event-date').keyup(function () {
    $("#errorfieldEventDate").removeClass("has-error");
});

HTML

<div class="form-group" data-bind="fadeVisible: isEventDateVisible">
    <label class="col-md-3 control-label">Event Date:</label>
    <div class="col-md-9">
        <div class="input-group">
            <input type="text" id="event-date" name="event-date" class="date-picker form-control date-picker-view" data-bind="value: eventItem().selectedEventDate" />
            <div class="input-group-addon">
                <span class="icon-info icon-info-calendar"></span>
            </div>
            <div class="input-group-addon">
                <span class="logo logo-required"></span>
                <span class="data required-box" data-bind="visible: isEventDateError"></span>
            </div>
        </div>
    </div>
</div>

1 个答案:

答案 0 :(得分:0)

您可以收听changeDate event

Example Here

$('#event-date').on('changeDate', function (e) {
    $("#errorfieldEventDate").removeClass("has-error");
});