当我使用带有表单域sharepoint控件的时间选择器时,我得到了errore的标签
这是我的jquery验证代码
$("input[id*='ffEnTime']").focusout(function () {
if ($("input[id*='ffEnTime']").val().trim() == "") {
$("span[id*='lblEntTime']").show();
$("span[id*='lblEntTime']").text("Write Entry Time");
}
else {
$("span[id*='lblEntTime']").hide();
}
}); 和我使用的时间选择器的代码
$(document).ready(function () {
//Start Validation at the after form loaded
$("input[id*='ffPltNo']").attr("maxlength", "4");
$("input[id*='ffIDNumber']").attr("maxlength", "10");
$("input[id*='ffEnTime']").attr("autocomplete", "off");
$("input[id*='ffEnTime']").attr("readOnly", "true");
$("input[id*='ffEnTime']").timepicker({
timeFormat: 'hh:mm p',
minTime: '06:30:00', // 11:45:00 AM,
maxHour: 24,
maxMinutes: 30,
startTime: new Date(0, 0, 0, 06, 0, 0), // 3:00:00 PM - noon
interval: 30
});所以它看起来像这个See pic
错误来了,因为当我单击任何时间选择它时,它将首先聚焦出来,然后验证将执行,最后它将选择时间,在这种情况下,我必须再次选择让标签消失
有什么建议用更好的东西取代focus out吗?
我试着改变,但对我不起作用。
发布于 2021-10-14 12:28:58
你试过了吗?
$("input[id*='ffEnTime']").on('input',function () {
//your validation function here
})https://stackoverflow.com/questions/69570356
复制相似问题