悬赏园豆:5
[已解决问题]
解决于 2008-06-25 15:31
<P>最近在.net aspx页面上,在使用JS脚本对FCKEditor控件时,发现有以下情况:</P>
<P>问题出在:我在cs页面中可以使用<SPAN style="COLOR: #800000">txtReportDef.value<FONT color=#000000>给这个赋值,但是通过脚本赋值我用alert是抛出了正常所要的值,但是页面上<SPAN style="COLOR: #800000">txtReportDef<FONT color=#000000>文本区的值没有变化。</FONT></SPAN></FONT></SPAN></P>
<P><SPAN style="COLOR: #800000"><SPAN style="COLOR: #800000"><FONT color=#000000>其中:<SPAN style="COLOR: #800000">lbSearchItem<FONT color=#000000>这个控件在cs页面邦定其值。</FONT></SPAN></FONT></SPAN></SPAN></P>
<DIV class=cnblogs_code><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><SPAN style="COLOR: #008080"> 1</SPAN><IMG src="http://space.cnblogs.com/Images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080"> 2</SPAN><SPAN style="COLOR: #000000"><IMG src="http://space.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000"><</SPAN><SPAN style="COLOR: #000000">html</SPAN><SPAN style="COLOR: #000000">></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080"> 3</SPAN><SPAN style="COLOR: #000000"><IMG src="http://space.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000"><</SPAN><SPAN style="COLOR: #000000">head</SPAN><SPAN style="COLOR: #000000">></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080"> 4</SPAN><SPAN style="COLOR: #000000"><IMG src="http://space.cnblogs.com/Images/OutliningIndicators/None.gif" align=top> </SPAN><SPAN style="COLOR: #000000"><</SPAN><SPAN style="COLOR: #000000">script language</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #800000">"</SPAN><SPAN style="COLOR: #800000">javascript</SPAN><SPAN style="COLOR: #800000">"</SPAN><SPAN style="COLOR: #000000">></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080"> 5</SPAN><SPAN style="COLOR: #000000"><IMG src="http://space.cnblogs.com/Images/OutliningIndicators/None.gif" align=top> function()<BR></SPAN><SPAN style="COLOR: #008080"> 6</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_63_240_Open_Image onclick="this.style.display='none'; document.getElementById('Codehighlighter1_63_240_Open_Text').style.display='none'; document.getElementById('Codehighlighter1_63_240_Closed_Image').style.display='inline'; document.getElementById('Codehighlighter1_63_240_Closed_Text').style.display='inline';" src="http://space.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top> </SPAN><SPAN id=Codehighlighter1_63_240_Open_Text><SPAN style="COLOR: #000000">{</SPAN></SPAN></DIV>
<DIV class=cnblogs_code><SPAN><SPAN style="COLOR: #000000"></SPAN><SPAN style="COLOR: #008080"> 7</SPAN><SPAN style="COLOR: #000000"><IMG src="http://space.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top> var ddlItems</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">document.all(</SPAN><SPAN style="COLOR: #800000">"</SPAN><SPAN style="COLOR: #800000">lbSearchItem</SPAN><SPAN style="COLOR: #800000">"</SPAN><SPAN style="COLOR: #000000">);<BR></SPAN><SPAN style="COLOR: #008080"> 8</SPAN><SPAN style="COLOR: #000000"><IMG src="http://space.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top> var selItemVal</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">ddlItems.options[ddlItems.selectedIndex].value; </SPAN></SPAN></DIV>
<DIV class=cnblogs_code><SPAN><SPAN style="COLOR: #000000"></SPAN><SPAN style="COLOR: #008080"> 9 </SPAN><SPAN style="COLOR: #000000">document.all(</SPAN><SPAN style="COLOR: #800000">"</SPAN><SPAN style="COLOR: #800000">txtReportDef</SPAN><SPAN style="COLOR: #800000">"</SPAN><SPAN style="COLOR: #000000">).value </SPAN><SPAN style="COLOR: #000000">+=</SPAN><SPAN style="COLOR: #000000"> selItemVal;<BR></SPAN><SPAN style="COLOR: #008080">10</SPAN><SPAN style="COLOR: #000000"><IMG src="http://space.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top> }</SPAN></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">11</SPAN><SPAN style="COLOR: #000000"><IMG src="http://space.cnblogs.com/Images/OutliningIndicators/None.gif" align=top> </SPAN><SPAN style="COLOR: #000000"></</SPAN><SPAN style="COLOR: #000000">script</SPAN><SPAN style="COLOR: #000000">></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">12</SPAN><SPAN style="COLOR: #000000"><IMG src="http://space.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000"></</SPAN><SPAN style="COLOR: #000000">head</SPAN><SPAN style="COLOR: #000000">></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">13</SPAN><SPAN style="COLOR: #000000"><IMG src="http://space.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000"><</SPAN><SPAN style="COLOR: #000000">body</SPAN><SPAN style="COLOR: #000000">></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">14</SPAN><SPAN style="COLOR: #000000"><IMG src="http://space.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000"><</SPAN><SPAN style="COLOR: #000000">form runat</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #800000">"</SPAN><SPAN style="COLOR: #800000">server</SPAN><SPAN style="COLOR: #800000">"</SPAN><SPAN style="COLOR: #000000">></SPAN></DIV>
<DIV class=cnblogs_code><SPAN style="COLOR: #000000"></SPAN><SPAN style="COLOR: #008080">15 </SPAN><SPAN style="COLOR: #000000"><</SPAN><SPAN style="COLOR: #000000">fck:FCKeditor id</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #800000">"</SPAN><SPAN style="COLOR: #800000">txtReportDef</SPAN><SPAN style="COLOR: #800000">"</SPAN><SPAN style="COLOR: #000000"> runat</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #800000">"</SPAN><SPAN style="COLOR: #800000">server</SPAN><SPAN style="COLOR: #800000">"</SPAN><SPAN style="COLOR: #000000"> BasePath</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #800000">"</SPAN><SPAN style="COLOR: #800000">~/Assistant/FCKeditor/</SPAN><SPAN style="COLOR: #800000">"</SPAN><SPAN style="COLOR: #000000"> ToolbarStartExpanded</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #800000">"</SPAN><SPAN style="COLOR: #800000">false</SPAN><SPAN style="COLOR: #800000">"</SPAN><SPAN style="COLOR: #000000"> Height</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #800000">"</SPAN><SPAN style="COLOR: #800000">100%</SPAN><SPAN style="COLOR: #800000">"</SPAN><SPAN style="COLOR: #000000">/></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">16 </SPAN><SPAN style="COLOR: #000000"></SPAN><SPAN style="COLOR: #000000"><</SPAN><SPAN style="COLOR: #000000">asp:ListBox ID</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #800000">"</SPAN><SPAN style="COLOR: #800000">lbSearchItem</SPAN><SPAN style="COLOR: #800000">"</SPAN><SPAN style="COLOR: #000000"> runat</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #800000">"</SPAN><SPAN style="COLOR: #800000">server</SPAN><SPAN style="COLOR: #800000">"</SPAN><SPAN style="COLOR: #000000"> Rows</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #800000">"</SPAN><SPAN style="COLOR: #800000">19</SPAN><SPAN style="COLOR: #800000">"</SPAN><SPAN style="COLOR: #000000"> Width</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #800000">"</SPAN><SPAN style="COLOR: #800000">100%</SPAN><SPAN style="COLOR: #800000">"</SPAN><SPAN style="COLOR: #000000">></</SPAN><SPAN style="COLOR: #000000">asp:ListBox</SPAN><SPAN style="COLOR: #000000">></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">17</SPAN><SPAN style="COLOR: #000000"><IMG src="http://space.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000"><</SPAN><SPAN style="COLOR: #000000">input id</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #800000">"</SPAN><SPAN style="COLOR: #800000">btn</SPAN><SPAN style="COLOR: #800000">"</SPAN><SPAN style="COLOR: #000000"> name</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #800000">"</SPAN><SPAN style="COLOR: #800000">submit</SPAN><SPAN style="COLOR: #800000">"</SPAN><SPAN style="COLOR: #000000"> type</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #800000">"</SPAN><SPAN style="COLOR: #800000">button</SPAN><SPAN style="COLOR: #800000">"</SPAN><SPAN style="COLOR: #000000"> onclick</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #800000">"</SPAN><SPAN style="COLOR: #800000">additem()</SPAN><SPAN style="COLOR: #800000">"</SPAN><SPAN style="COLOR: #000000">/></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">18</SPAN><SPAN style="COLOR: #000000"><IMG src="http://space.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000"></</SPAN><SPAN style="COLOR: #000000">form</SPAN><SPAN style="COLOR: #000000">></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">19</SPAN><SPAN style="COLOR: #000000"><IMG src="http://space.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000"></</SPAN><SPAN style="COLOR: #000000">body</SPAN><SPAN style="COLOR: #000000">></SPAN></DIV>
问题补充:
怎么敲出来都是乱码,第5行是函数 function additem(){