Javascript SharePoint 2007 |如果单击复选框,如何启用禁用字段
嗨,想知道我错过了什么Javascript SharePoint 2007 |如果单击复选框,如何启用禁用字段,javascript,jquery,sharepoint-2007,Javascript,Jquery,Sharepoint 2007,嗨,想知道我错过了什么 function executeMe(){ if(document.getElementById("ctl00_m_g_ef941f4a_7f2d_4a75_a119_6f009e7a22ad_ctl00_ctl04_ctl04_ctl00_ctl00_ctl04_ctl00_ctl00").checked{ document.getElementById("ctl00_m_g_ef941f4a_7f2d_4a75_a119_6f009e7a22ad_ctl00_ct
function executeMe(){
if(document.getElementById("ctl00_m_g_ef941f4a_7f2d_4a75_a119_6f009e7a22ad_ctl00_ctl04_ctl04_ctl00_ctl00_ctl04_ctl00_ctl00").checked{
document.getElementById("ctl00_m_g_ef941f4a_7f2d_4a75_a119_6f009e7a22ad_ctl00_ctl04_ctl03_ctl00_ctl00_ctl04_ctl00_ctl00_TextField").disabled=false;
}else{
document.getElementById("ctl00_m_g_ef941f4a_7f2d_4a75_a119_6f009e7a22ad_ctl00_ctl04_ctl03_ctl00_ctl00_ctl04_ctl00_ctl00_TextField").disabled=true;
}
当我检查按钮时,它仍然处于禁用状态 您的代码应该是这样的。按照上述代码再次更改ID
function executeMe()
{
if(document.getElementById("chkbox").checked)
{
document.getElementById("Text1").disabled=true;
}
else
{
document.getElementById"Text1").disabled=false;
}
}
这应该管用 如果你不把所有的东西都放在一行,你的答案会更可读。您可以根据需要使用任意多行代码,只需在每行的开头加上四个空格。谢谢Kevin,在这方面帮助了我。今天是我第一次成为Stackoverflow.com的会员