由于他们无法查看表明他们同意使用条款的复选框,我收到了一些人无法在我的网站上注册的报告。基本上,一旦选中该复选框,就会启用一个按钮以允许其继续注册。
我已经尝试过很多次,单击实际的复选框并没有做任何事情,但通常会点击相关标签。我已经将其作为解决方法,但我真的希望一直点击实际的复选框工作。
注册页面为:http://www.lonelycache.com/Account/GeocachingAuth.aspx
页面表单的复选框具有以下内容(为便于阅读而格式化):
<asp:CheckBox ID="AgreeTOUCheckBox"
AutoPostBack="true"
runat="server" Text=" I have read and agree to the"
OnCheckedChanged="AgreeTOUCheckBox_OnCheckChanged" />
生成的html(为便于阅读而格式化):
<input id="MainContent_AgreeTOUCheckBox" type="checkbox"
name="ctl00$MainContent$AgreeTOUCheckBox"
onclick="javascript:setTimeout('__doPostBack(\'ctl00$MainContent$AgreeTOUCheckBox\',\'\')', 0)"
/>
<label for="MainContent_AgreeTOUCheckBox"> I have read and agree to the</label>
关于如何使其始终如一地工作的任何想法?
答案 0 :(得分:3)
您的复选框工作正常,它只是隐藏在另一个面板后面。如果您单击并拖动复选框下方以突出显示页面本身,您可以看到左侧足迹面板隐藏了大部分复选框。
尝试点击复选框的右边缘即可。
这可能就像调整你的风格一样容易:
<div style="padding-left:10px">
<asp:CheckBox ID="AgreeTOUCheckBox"
AutoPostBack="true"
runat="server" Text=" I have read and agree to the"
OnCheckedChanged="AgreeTOUCheckBox_OnCheckChanged" />
</div>
您的“授权”按钮也是如此。尝试点击它的左边,它将无法正常工作。
请告诉我这是否适合您。
答案 1 :(得分:3)
此问题与ASP.NET无关。我检查了你的网站,你有一个DIV(id:靴子),它位于大多数复选框的顶部(它显示左侧的靴子图像,因为它是背景图像)。
如果你将div的宽度设置为180px而不是200px,它应该可以解决你的问题,
答案 2 :(得分:1)
我测试了你的网站。我也无法检查。
根据我测试的内容,您的复选框只是启用按钮。如果是这样,你可以简单地使用jQuery来做到这一点。
以下是样本:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('#<%= AgreeTOUCheckBox.ClientID %>').click(function () {
if ($('#<%= AgreeTOUCheckBox.ClientID %>').attr('checked')) {
$('#<%= AuthorizeButton.ClientID %>').removeAttr("disabled");
} else {
$('#<%= AuthorizeButton.ClientID %>').prop("disabled", "disabled");
}
});
});
</script>
<asp:CheckBox ID="AgreeTOUCheckBox" runat="server"
Text=" I have read and agree to the" />
<asp:Button runat="server" ID="AuthorizeButton"
Text="Authorize" Enabled="False"/>