刚学ajax,遇到一个奇怪的问题,textarea内容无法用javascript”打印“ - Web 开发 / Ajax
问题是这样的,我用ajax做一个发站内短信的东东,但是那个短信内容用始终显示不出来,在postNewMsg()函数中,能够检查到msgcontent是否填写了,如果没有填写,函数的alert能正常提示工作,但是getInfo( "message.asp?msg_action=postnewmsg&msgtouser= "+msgtouser.value+ "&msgtitle= "+msgtitle.value+ "&msgcontent= "+msgcontent.value+ " ");这句话中,msgcontent无法传递给message.asp(其他参数都传过去了)。后来我又加了一句测试的语句就是
document.getElementById( "my_main ").innerHTML =msgcontent.value;这句话也死活不正常,如果是表单中的其他元素,上一句则能正常显示比如document.getElementById( "my_main ").innerHTML =msgtouser.value; 就能显示你在表单中填写的收件人。我实在搞不懂为什么msgcontent不行,而其他表单元素就行啊??高人指点迷津啊!!!
*******************************
<form id= "newmsgform " name= "newmsgform " onSubmit= "return false; ">
<table width= "610 " border= "0 " cellpadding= "0 " cellspacing= "1 " bgcolor= "#AEDF47 ">
<tr class= "a1 ">
<td height= "25 " colspan= "2 "> <div align= "center " class= "a1 "> 发短信(请输入完整信息) </div> </td>
</tr>
<tr>
<td width= "84 " height= "25 " bgcolor= "#FFFFFF "> <span style= "font-weight: bold "> 收件人: </span> </td>
<td width= "523 " bgcolor= "#FFFFFF "> <input type=text name= "msgtouser " value= " <%=request( "msgtouser ")%> " size=50>
<SELECT name=touser onChange= "DoTitle(this.options[this.selectedIndex].value); ">
<OPTION selected value= " "> 选择 </OPTION>
<%dim rs,sql
set rs=server.createobject( "adodb.recordset ")
sql= "select userrealname from [user] order by userid desc "
rs.open sql,conn,1,1
do while not rs.eof
%>
<OPTION value= " <%=rs(0)%> "> <%=rs(0)%> </OPTION>
<%
rs.movenext
loop
rs.close
set rs=nothing
%>
</SELECT> </td>
</tr>
<tr>
<td height= "25 " bgcolor= "#FFFFFF "> <span style= "font-weight: bold "> 主 题: </span> </td>
<td bgcolor= "#FFFFFF "> <input name= "msgtitle " type= "text " size= "60 " maxlength= "50 "> </td>
</tr>
<tr>
<td height= "25 " valign= "top " bgcolor= "#FFFFFF "> <span style= "font-weight: bold "> <br>
&nbs