Javascript 如何使用函数true验证jquery步骤中隐藏的空字段
我有一些字段在使用表单时自己编写,所有字段都是隐藏的,我想知道如何使jquery验证字段是否为空 这是输入Javascript 如何使用函数true验证jquery步骤中隐藏的空字段,javascript,jquery,Javascript,Jquery,我有一些字段在使用表单时自己编写,所有字段都是隐藏的,我想知道如何使jquery验证字段是否为空 这是输入 <input id="location_id" type="number" class="form-control" name="location_id"> 我解决了,我只是将我的函数添加到OnStepChanging中并返回false if (locationEmpty) { $('#al
<input id="location_id" type="number"
class="form-control" name="location_id">
我解决了,我只是将我的函数添加到OnStepChanging中并返回
false
if (locationEmpty) {
$('#alert_location_empty').show();
setTimeout(function () {
$('#alert_location_empty').hide();
}, 3000);
return false;
}
function checkLocationEmpty() {
if (document.getElementById("location_id").value.length == 0) {
return true;
}
return false;
}
if (locationEmpty) {
$('#alert_location_empty').show();
setTimeout(function () {
$('#alert_location_empty').hide();
}, 3000);
return false;
}