【发布时间】:2014-05-21 23:42:14
【问题描述】:
我的 Jquery 函数有问题。如果表单的字段为空,我想禁用按钮#next,如果字段不再为空,我想禁用按钮...但是当字段不为空时,#next 不会改变... 对我有帮助吗? :/ 谢谢!
$(function () {
$('#next').prop("disabled", true).css({
"background-color": "#424242",
"cursor": "default"
});
if ($('.idinput').val() != '') {
$('#next').prop("disabled", false).css({
"background-color": "#1C1C1C",
"cursor": "pointer"
});
$('#next').click(function () {
$('#regdiv').animate({
left: "-=400"
}, 2000, function () {
$('#next').prop("disabled", true).css({
"background-color": "#424242",
"cursor": "default"
});
$('#class').show("slide", {
direction: "left"
}, 1500);
});
});
} else {
$('#next').prop("disabled", true).css({
"background-color": "#424242",
"cursor": "default"
});
}
});
【问题讨论】:
-
你的 HTML 表单在哪里?
-
我搜索了如何做到这一点......我只是个菜鸟。
标签: javascript jquery function