请高手帮忙看一下,谢谢~~~
这是源代码:<html>
<head>
<script lanuage="javascript">
function DelTabelRow(obj)
{
var clickedRow=obj;
clickedRow.parentNode.removeChild(clickedRow);
}
function AddNullInfo()
{
var i=0;
var newTr=FilterInfo.insertRow();
var newTd0 = newTr.insertCell();
//Set TableCell's properties
newTd0.innerHTML = '<input type="button" id=\"removeBtn\" value="Remove" onClick=\"javascript:DelTabelRow(this)\">'; //加上这句就会出错
var newTd1 = newTr.insertCell();
newTd1.innerHTML= '<input type="button" id="DownBtn" value="^" style="width:30px;height:25px;">';
var newTd2=newTr.insertCell();
newTd2.innerHTML='<input type=\"button\" id="UpBtn" value="V" style="width:30px;height:25px;">';
var newTd3=newTr.insertCell();
newTd3.innerHTML='<select name="RelSel"><option value="">-Null-</option><option>AND</option><option>OR</option></select>';
var newTd4=newTr.insertCell();
newTd4.innerHTML='<select name=\"KuoSel\"><option>(</option><option>((</option><option>(((</option><option>)</option><option>))</option><option>)))</option></select>';
}
</script>
</head>
<body class="FONTStyle">
<form id="FormMain" method="post">
<input type="hidden" name="provalue" value="1" />
<input type="radio" name="Use Filter Helper" checked="checked"/>
<font color="#0066CC"><b>User Filter Helper</b></font>
<table width="740" height="120" border="0" id="DataTb">
<tr>
<th width="106" height="29" align="right" scope="col"></th>
<th width="200" scope="col" align="center"><font size="-1" face="Arial, Helvetica, sans-serif">Field</font></th>
<th width="200" scope="col" align="center"><font size="-1" face="Arial, Helvetica, sans-serif">Option</font></th>
<th width="175" scope="col" align="center"><font size="-1" face="Arial, Helvetica, sans-serif">Value</font></th>
<th width="37" scope="col"> </th>
</tr>
<tr>
<th height="48" align="right" scope="row"><font size="-1" face="Arial, Helvetica, sans-serif">Profile Field</font></th>
<td align="center"><select name="ComboField" id="combofield" style="width:200" class="FONTStyle" onChange="javascript:ChangeOption()">
<option selected="selected">EmailAddr</option>
<option>FirstName</option>
<option>LastName</option>
<option>PlatForm</option>
<option>ClientUnsubscribe</option>
<option>ValidEmailAddr</option>
<option>HtmlCapable</option>
<option>ClcStatus</option>
<option>No</option>
<option>Age</option>
<option>gender</option>
<option>interest</option>
<option>product</option>
<option>Kevin_DM_test</option>
<option>Title</option>
<option>CompanyName</option>
<option>interest2</option>
<option>MarketSector</option>
<option>New</option>
<option>Lanuage</option>
<option>Location</option>
<option>Frequency</option>
<option>Nationnality</option>
<option>Source</option>
<option>PointsBalance</option>
<option>datasrc</option>
<option>usertype</option>
<option>Member_ID</option>
<option>Unsubscribe</option>
<option>SiteClcStatus</option>
</select></td>
<td align="center"><select name="ComboOption" id="combooption" style="width:200" size="1" class="FONTStyle">
<script language="javascript">
if(document.)
{
document.(new Option("is",1));
document.(new Option("is not",2));
document.(new Option("starts with",3));
document.(new Option("does not start with",4));
document.(new Option("ends with",5));
document.(new Option("does not end with",6));
document.(new Option("comes before",7));
document.(new Option("comes after",8));
document.(new Option("comes before or is equal to",9));
document.(new Option("comes after or is equal to",10));
document.(new Option("cantain",11));
document.(new Option("does not contain",12));
document.(new Option("is null",13));
document.(new Option("is not null",14));
document.(new Option("is empty",15));
document.(new Option("is not empty",16));
}
</script>
</select></td>
<td align="center"><input type="text" name="txtValue" height="20" size="25"/></td>
<td align="center"><input type="button" name="btnAddField" value="Add" onClick="javascript:AddInfo()">
</td>
</tr>
<tr>
<th height="35" align="right" scope="row"><font size="-1" face="Arial, Helvetica, sans-serif">Profile Date Field</font></th>
<td align="center"><select name="ComboOption" id="combooption" style="width:200" class="FONTStyle">
<option selected="selected">JoinDate</option>
<option>Client_FirstJoinDate</option>
<option>Client_LastClickDate</option>
<option>Client_LastOpenDate</option>
<option>Client_LastSpotlightPurchaseDate</option>
<option>Client_LastSpotlightEventDate</option>
<option>trialdate</option>
<option>Site_FirstJoinDate</option>
<option>Site_LastClickDate</option>
<option>Site_LastOpenDate</option>
<option>Site_LastSpotlightPurchaseDate</option>
<option>Site_LastSpotlightEventDate</option>
</select></td>
<td> </td>
<td> </td>
<td align="center"><input type="button" name="btnAddDate" value="Add" /></td>
</tr></table>
<label style="background-color:#006699;width:800"><font color="#FFFFFF"><b>Expression Builder</b></font></label><br>
<input type="button" name="btnInsert" value="Insert Bracket" class="FONTStyle"
onClick="javascript:AddNullInfo()"/>//在这里调用函数时报错:该对象不存在
<table cellpadding="0" border="0" id="FilterInfo">
</table>
<p class="FONTStyle"> </p>
<p class="FONTStyle"><label style="background-color:#006699;width:800"><font color="#FFFFFF"><b>Expression</b></font></label></p>
</form>
</body>
</html>
因为需要动态添加表格的行列,以及行列中的控件,所以采取innerHTML方法来添加,但不知道为什么,在添加的按钮中只要加上点击事件的调用,就会报错:调用的函数不存在。我改了好久还是不行,有哪位高手帮忙解决一下,不胜感谢呀!!!
[[it] 本帖最后由 shimmer8711 于 2008-9-23 11:07 编辑 [/it]]