它显示的错误是'dd[..].length'为空或不是对象,这是怎么回事呢,谢谢!
解决方案 »
- 求解惑..
- 请问JS里如何获取<input type="file">里的文本路径和JS里如何设置img标签里的 src的路径了?
- 怎样给这个 strTopContentHTML +="<a href='#' onclick=...">加一个超链接
- 关于ActiveX控件的显示问题
- 急,求一正则:只能输入数字和“.”,如:1.2、1.2.12.1、2.1等,谢谢!!!
- 关于URL编码的问题,谢谢大家!
- 请问怎样在下拉表中怎样让他拉出图片呢<SELECT 。。><OPTION>图片</OPTION>
- JScript字符串替换?小问题,高技巧!
- html5游戏开发,有什么著名、流行的框架吗?
- jquery跨域加载页面的问题
- 用document.write写script标记无效
- 正则表达式如何匹配多行
<head>
<link rel=stylesheet href="style.css" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel=stylesheet href="style.css" type="text/css">
<title>Call Forwarding</title>
</head>
<body>
<form name="form1" method="post">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="80%"><table width="457" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="34" align="left" class="style2"></td>
</tr>
<tr>
<td align="left" class="style1"><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td height="20" colspan="2" valign="middle" bgcolor="#FFFFFF" align="center" class="t_one"></td>
</tr>
<tr>
<td height="20" colspan="2" valign="middle" bgcolor="#FFFFFF" align="left">></td>
</tr> <tr>
<td height="20" colspan="2" align="left" valign="middle" bgcolor="#FFFFFF"> <input type="text" id="ID" name="p_callerid" size="32" maxlength="32" value="$$p_callerid$$"></td>
</tr>
<tr>
<td width="210" height="20" align="center" valign="middle" bgcolor="#FFFFFF"></td>
<td width="241" height="20"align="center" valign="middle" bgcolor="#FFFFFF">
<input type="hidden" name="P_Callerid" value="$$P_Callerid$$">
<input type="hidden" name="P_Callerid1" value="$$P_Callerid1$$">
<input type="hidden" name="P_Callerid2" value="$$P_Callerid2$$">
<input type="hidden" name="P_Callerid3" value="$$P_Callerid3$$">
<input type="hidden" name="P_Callerid4" value="$$P_Callerid4$$">
<input type="hidden" name="P_Callerid5" value="$$P_Callerid5$$">
<input type="hidden" name="P_Callerid6" value="$$P_Callerid6$$">
<input type="hidden" name="P_Callerid7" value="$$P_Callerid7$$">
<input type="hidden" name="P_Callerid8" value="$$P_Callerid8$$">
<input type="hidden" name="P_Callerid9" value="$$P_Callerid9$$"> <input type="hidden" name="idlist" value="$$idlist$$">
<select name="CIDL" id="cidl" size="15">
<option value="CallerIDList"> </option>
</select>
</td></tr>
</table></td></tr>
<tr>
<td height="20" align="right" valign="middle" bgcolor="#FFFFFF">
<input type="button" name="add" value="Add" onclick="onadd()">
<input type="button" name="delete" value="Delete" onclick="ondelete()">
<input type="button" name="clear" value="Clear All" onclick="onclearall()">
<input type="button" name="apply" value="Apply" onclick="onapply()">
</td>
</tr>
</table>
</form>
<script language="javascript">
for(var s=0;s<10;s++)
{
document.form1.idlist.value=document.form1.idlist.value+document.form1.elements[s+7].value;
}
num=document.form1.idlist.value.split(",");
for(var k=1;k<(num.length);k++)
{
var option =document.createElement("OPTION");
option.value=num[k];
option.text=num[k];
var nums = document.form1.CIDL.options.length;
document.form1.CIDL.options[nums]=option;
}
function onadd(){ var sel1 = document.form1.p_callerid.value;
var sel2 = document.form1.CIDL;
var option =document.createElement("OPTION");
option.value=sel1;
option.text=sel1;
var items = sel2.options.length;
sel2.options[items]=option;
document.form1.CIDL[items].value=option.value;
document.form1.CIDL[items].text=option.text;
document.form1.idlist.value=document.form1.idlist.value+','+document.form1.ID.value;
document.form1.p_callerid.value="";
}
function ondelete(){
var num = document.form1.CIDL.selectedIndex;
if (num>0)
document.form1.CIDL.options[num] = null;
else
document.form1.CIDL.selectedIndex = 10000;
dd=document.form1.idlist.value.split(",");
ddstring="";
for(var j=1;j<(num);j++)
{
ddstring=ddstring+','+dd[j];
}
for(var k=(num+1);k<(dd.length);k++)
{
ddstring=ddstring+','+dd[k];
}
document.form1.idlist.value=ddstring;
}
function onclearall(){
allid=document.form1.CIDL.options.length;
for(var i=(allid-1);i>0;i--){
document.form1.CIDL.options[i] = null;
}
document.form1.idlist.value="";
}
function onapply() {
document.form1.elements[7].value="";
document.form1.elements[8].value="";
document.form1.elements[9].value="";
document.form1.elements[10].value="";
document.form1.elements[11].value="";
document.form1.elements[12].value="";
document.form1.elements[13].value="";
document.form1.elements[14].value="";
document.form1.elements[15].value="";
var ALL_num = document.form1.CIDL.selectedIndex;
dd=document.form1.idlist.value.split(",");
num=0;
num1=0;
for(var i=0;i<10;i++)
{
num=num+num1;
for(var j=num;j<(ALL_num);j++)
{
num1=0;
num1=num1+dd[j].length;
if((num1*32+num1)>99)
return num1;
}
for(var k=num+1;k<(num1);k++)
{
document.form1.elements[i+7].value=document.form1.elements[i+7].value +','+dd[k] ;
}
}
document.form1.idlist.value="";
document.form1.submit();
}
for(var j=1;j<(num) && j<(dd.length);j++)
{
ddstring=ddstring+','+dd[j];
}
for(var k=(num+1);k<(dd.length);k++)
{
ddstring=ddstring+','+dd[k];
}