net网站 JS脚本 Javascript 脚本 document.all[..] 为空或者不是对象 要怎么解决? 20
//单选按扭(单击事件,含复选框)functionRadioClick(Listid,ListCN,ListEN){vardom=document.all;varel=e...
//单选按扭(单击事件,含复选框)
function RadioClick(Listid,ListCN,ListEN)
{
var dom = document.all;
var el = event.srcElement;
if(el.tagName=="INPUT"&&el.type.toLowerCase()=="radio")
{
for(i=0;i<dom.length;i++)
{
if(dom[i].tagName=="INPUT" && dom[i].type.toLowerCase()=="radio")
{
dom[i].checked=false;
}
}
}
el.checked=true;
//初始化复选框
for(var i=0;i<document.all.length;i++)
{
if(document.all[i].name!=null)
{
if(document.all[i].name.indexOf("chk_CnResume") > 0)
{
document.all[i].disabled = true;
document.all[i].checked = false;
}
if(document.all[i].name.indexOf("chk_EnResume") > 0)
{
document.all[i].disabled = true;
document.all[i].checked = false;
}
}
}
//设置选择的复选框
if(ListCN == "1")
{
document.all["lit_ResumeList__ctl"+" Listid" +"_chk_CnResume"].checked = true;
document.all["lit_ResumeList__ctl"+ Listid +"_chk_CnResume"].disabled = false;
}
if(ListEN == "1")
{
document.all["lit_ResumeList__ctl"+ "Listid" +"_chk_EnResume"].checked = true;
document.all["lit_ResumeList__ctl"+ "Listid" +"_chk_EnResume"].disabled = false;
}
}
//页面复选框初始化
function PageChkLoad()
{
for(var i=0;i<document.all.length;i++)
{
if(document.all[i].name!=null)
{
if(document.all[i].name.indexOf("chk_CnResume") > 0)
{
document.all[i].disabled = true;
}
if(document.all[i].name.indexOf("chk_EnResume") > 0)
{
document.all[i].disabled = true;
}
}
}
}
function PageCutChkLoad(Listid,ListCN,ListEN)
{
if(ListCN == "1")
{
document.all["lit_ResumeList__ctl"+ "Listid"+"_chk_CnResume"].disabled = false;
}
if(ListEN == "1")
{
document.all["lit_ResumeList__ctl"+ "Listid " +"_chk_EnResume"].disabled = false;
}
}
//改变附求职信
function LetterChanged()
{
var obj = document.all["chk_Letter"];
if (obj != null)
{
if(document.all["chk_Letter"].checked == false)
{
document.all['txt_Letter'].value = "";
document.all['ddl_Letter'].disabled = true;
document.all['txt_Letter'].disabled = true;
}
else
{
document.all['ddl_Letter'].disabled = false;
document.all['txt_Letter'].disabled = false;
}
}
}
//选择求职信
function ChangeLetter(LetterCount)
{
var letterID= "";
var title ="";
var selectedIndex = "";
letterID = document.all['ddl_Letter'].value;
selectedIndex = document.all['ddl_Letter'].selectedIndex;
title = document.all['ddl_Letter'].options[ selectedIndex ].text;
for (var i=1;i<=LetterCount;i++)
{
if(document.all["Hidden" + letterID] != null)
{
document.all.txt_Letter.value = document.all["Hidden"+letterID].value.replace(/</g,"<").replace(/>/g,">").replace(/"/g,"\"").replace(/&/g,"&");
}
else
{
document.all.txt_Letter.value="";
}
}
}
//单选按扭(单击事件,不含复选框)
function RadioClick2(Listid)
{
var dom = document.all;
var el = event.srcElement;
if(el.tagName=="INPUT"&&el.type.toLowerCase()=="radio")
{
for(i=0;i<dom.length;i++)
{
if(dom[i].tagName=="INPUT" && dom[i].type.toLowerCase()=="radio")
{
dom[i].checked=false;
}
}
}
el.checked=true;
}
已经选择了 复选框函数读取不到 一直跳出选择复选框
ccyingfu 你好 我用的是IE5.0 展开
function RadioClick(Listid,ListCN,ListEN)
{
var dom = document.all;
var el = event.srcElement;
if(el.tagName=="INPUT"&&el.type.toLowerCase()=="radio")
{
for(i=0;i<dom.length;i++)
{
if(dom[i].tagName=="INPUT" && dom[i].type.toLowerCase()=="radio")
{
dom[i].checked=false;
}
}
}
el.checked=true;
//初始化复选框
for(var i=0;i<document.all.length;i++)
{
if(document.all[i].name!=null)
{
if(document.all[i].name.indexOf("chk_CnResume") > 0)
{
document.all[i].disabled = true;
document.all[i].checked = false;
}
if(document.all[i].name.indexOf("chk_EnResume") > 0)
{
document.all[i].disabled = true;
document.all[i].checked = false;
}
}
}
//设置选择的复选框
if(ListCN == "1")
{
document.all["lit_ResumeList__ctl"+" Listid" +"_chk_CnResume"].checked = true;
document.all["lit_ResumeList__ctl"+ Listid +"_chk_CnResume"].disabled = false;
}
if(ListEN == "1")
{
document.all["lit_ResumeList__ctl"+ "Listid" +"_chk_EnResume"].checked = true;
document.all["lit_ResumeList__ctl"+ "Listid" +"_chk_EnResume"].disabled = false;
}
}
//页面复选框初始化
function PageChkLoad()
{
for(var i=0;i<document.all.length;i++)
{
if(document.all[i].name!=null)
{
if(document.all[i].name.indexOf("chk_CnResume") > 0)
{
document.all[i].disabled = true;
}
if(document.all[i].name.indexOf("chk_EnResume") > 0)
{
document.all[i].disabled = true;
}
}
}
}
function PageCutChkLoad(Listid,ListCN,ListEN)
{
if(ListCN == "1")
{
document.all["lit_ResumeList__ctl"+ "Listid"+"_chk_CnResume"].disabled = false;
}
if(ListEN == "1")
{
document.all["lit_ResumeList__ctl"+ "Listid " +"_chk_EnResume"].disabled = false;
}
}
//改变附求职信
function LetterChanged()
{
var obj = document.all["chk_Letter"];
if (obj != null)
{
if(document.all["chk_Letter"].checked == false)
{
document.all['txt_Letter'].value = "";
document.all['ddl_Letter'].disabled = true;
document.all['txt_Letter'].disabled = true;
}
else
{
document.all['ddl_Letter'].disabled = false;
document.all['txt_Letter'].disabled = false;
}
}
}
//选择求职信
function ChangeLetter(LetterCount)
{
var letterID= "";
var title ="";
var selectedIndex = "";
letterID = document.all['ddl_Letter'].value;
selectedIndex = document.all['ddl_Letter'].selectedIndex;
title = document.all['ddl_Letter'].options[ selectedIndex ].text;
for (var i=1;i<=LetterCount;i++)
{
if(document.all["Hidden" + letterID] != null)
{
document.all.txt_Letter.value = document.all["Hidden"+letterID].value.replace(/</g,"<").replace(/>/g,">").replace(/"/g,"\"").replace(/&/g,"&");
}
else
{
document.all.txt_Letter.value="";
}
}
}
//单选按扭(单击事件,不含复选框)
function RadioClick2(Listid)
{
var dom = document.all;
var el = event.srcElement;
if(el.tagName=="INPUT"&&el.type.toLowerCase()=="radio")
{
for(i=0;i<dom.length;i++)
{
if(dom[i].tagName=="INPUT" && dom[i].type.toLowerCase()=="radio")
{
dom[i].checked=false;
}
}
}
el.checked=true;
}
已经选择了 复选框函数读取不到 一直跳出选择复选框
ccyingfu 你好 我用的是IE5.0 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询