jQuery UI复选框不会激活收音机或输入框 [英] JQuery UI Check Box Doesn't Activate Radio Set Or Input Box

查看:77
本文介绍了jQuery UI复选框不会激活收音机或输入框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我已经搜索并尝试了许多不同的解决方案",但还没有一个对我有用.我正在使用JQuery和JQuery UI.我有一个表单中的几行,并且在每一行的开始处都有一个复选框,一旦选中该复选框,即可启用该行中的其余元素.问题是该复选框无法启用我的收音机或输入框.

如果将复选框仅转换为按钮,则效果很好,但不能用作复选框.这是我的JQuery代码:

Hello everyone,
I have searched and tried many different "solutions" but none have worked out yet for me. I am using JQuery and JQuery UI. I have several rows in a form and at the start of each row I have a check box that, once checked, enables the rest of the elements within that row. The problem is that the check box doesn''t enable the radio set or the input box that I have.

If I convert the check box to just a button, it works great, but not as a check box. Here is my JQuery code:

$( ".Account" ).attr('disabled', 'disabled').button('refresh');

$("#InputAD").click(function() {
   var jq = $("#InputADID, #InputADAction1, #InputADAction2, #InputADAction3,);
					
   if (jq.filter(":disabled").length)
      jq.removeAttr('disabled').button('refresh');
   else
      jq.attr('disabled', 'disabled').button('refresh');
   return false;
});



现在,对于可以正常工作的HTML代码:



Now for the HTML code that DOES work:

<button id="InputAD" name="InputAD"><label for="InputAD">Active Directory</label>

<input type="text" id="InputADID" name="InputADID" placeholder="Username" maxlength="50" class="Account">

<input type="radio" id="InputADAction1" name="InputADAction" checked="checked" class="Account"/><label for="InputADAction1">Add Account</label>

<input type="radio" id="InputADAction2" name="InputADAction" class="Account" /><label for="InputADAction2">Modify Account</label>

<input type="radio" id="InputADAction3" name="InputADAction" class="Account" /><label for="InputADAction3">Already Done</label>



问题是我真的需要一个复选框而不是一个按钮来开始每一行(出于视觉原因和我的ASP工作方式).如果我输入以下代码而不是按钮行,则它不起作用.该复选框突出显示就可以了,但是不会启用其余的行:



The problem is that I really need to have a check box rather then a button to start each row (for visual reasons and for the way my ASP works). If I put in the following code instead of the button line it doesn''t work. The check box highlights just fine, but doesn''t enable the rest of the row:

<input type="checkbox" id="InputAD" name"=InputAD" /><label for="InputAD">Active Directory</label>



关于我做错了什么或其他解决方法的想法?



Any ideas on what I''m doing wrong or other ways to handle this?

推荐答案

(" .Account").attr(已禁用' span>,' 已禁用').button(' 刷新');
( ".Account" ).attr('disabled', 'disabled').button('refresh');


(" #InputAD").click(function(){ var jq =
("#InputAD").click(function() { var jq =


(" :disabled ).length) jq.removeAttr('disabled').button('refresh'); 别的 jq.attr('disabled','disabled').button('refresh'); 返回false; });
("#InputADID, #InputADAction1, #InputADAction2, #InputADAction3,); if (jq.filter(":disabled").length) jq.removeAttr('disabled').button('refresh'); else jq.attr('disabled', 'disabled').button('refresh'); return false; });



现在,对于可以正常工作的HTML代码:



Now for the HTML code that DOES work:

<button id="InputAD" name="InputAD"><label for="InputAD">Active Directory</label>

<input type="text" id="InputADID" name="InputADID" placeholder="Username" maxlength="50" class="Account">

<input type="radio" id="InputADAction1" name="InputADAction" checked="checked" class="Account"/><label for="InputADAction1">Add Account</label>

<input type="radio" id="InputADAction2" name="InputADAction" class="Account" /><label for="InputADAction2">Modify Account</label>

<input type="radio" id="InputADAction3" name="InputADAction" class="Account" /><label for="InputADAction3">Already Done</label>



问题是我真的需要一个复选框而不是一个按钮来开始每一行(出于视觉原因和我的ASP工作方式).如果我输入以下代码而不是按钮行,则它不起作用.该复选框突出显示就可以了,但是不会启用其余的行:



The problem is that I really need to have a check box rather then a button to start each row (for visual reasons and for the way my ASP works). If I put in the following code instead of the button line it doesn''t work. The check box highlights just fine, but doesn''t enable the rest of the row:

<input type="checkbox" id="InputAD" name"=InputAD" /><label for="InputAD">Active Directory</label>



关于我做错了什么或其他解决方法的想法吗?



Any ideas on what I''m doing wrong or other ways to handle this?


这篇关于jQuery UI复选框不会激活收音机或输入框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆