我的页面加载时运行
$(document).ready(function() {
$(".indent1").each(function(){
if($(":checkbox").is(':checked')){
$('input[type="text"]').prop("disabled", true);
}
});});
代码错误地禁用了第二个转发器中的文本框 即使复选框未锁定。 如何才能正确禁用第一个文本框? html page with text incorrectly disabled in 2nd repeater 罗宾
答案 0 :(得分:0)
您的功能会禁用每个 from flask import abort
@app.route("/some_route")
def some_route():
try:
# do something
except SomeException:
abort("Some message", 400)
,而不仅仅是转发器内的 input[type=text]
。假设您尝试禁用的输入是.indent1
的孩子,请尝试以下操作:
$(document).ready(function() {
$(".indent1").each(function(){
var $checkbox = $(this).find(':checkbox');
var $input = $(this).find('input[type="text"]');
if($checkbox.is(':checked')){
$input.prop("disabled", true);
}
});
});