Hi,
I have a textarea for users to type response message in and a select option for canned responses in case users want to use them. What I want is to insert some value into the textarea when the select "onchange" fires. I got the value populated fine into the select listbox but I can't not get anything written into the textarea (without submit the form) on the onchange event. Thanks in advance for your help.
Below is the code I currently have:
<select id="optCResponse" name="optCResponse" onchange = "SelectCResponse(this)";>
<Option value="" selected>Select a Canned Response</option>
<%
While Not rs.EOF
%>
<option name="optCResponse" value="<%= rs("Description")%>"><b> <%= rs("CResponseID")%></b>  <%= left(rs("Description"), 20)%>...</option>
<%
RS.MoveNext
WEnd
rs.Close
objConn.Close
Set rs = Nothing
Set objConn = Nothing
%>
</select>
<tr>
<td class=font><p> <b>Reply Message</b>
<textarea name="txtRespMessage" size=8000 rows="8" cols="40" wrap="VIRTUAL" scrolling="yes" value="<%= request.form("txtRespMessage")%>"></textarea>
<script type="text/javascript">
function SelectCResponse(theForm)
{
theForm.txtRespMessage.value = "write something here"
}
I have a textarea for users to type response message in and a select option for canned responses in case users want to use them. What I want is to insert some value into the textarea when the select "onchange" fires. I got the value populated fine into the select listbox but I can't not get anything written into the textarea (without submit the form) on the onchange event. Thanks in advance for your help.
Below is the code I currently have:
<select id="optCResponse" name="optCResponse" onchange = "SelectCResponse(this)";>
<Option value="" selected>Select a Canned Response</option>
<%
While Not rs.EOF
%>
<option name="optCResponse" value="<%= rs("Description")%>"><b> <%= rs("CResponseID")%></b>  <%= left(rs("Description"), 20)%>...</option>
<%
RS.MoveNext
WEnd
rs.Close
objConn.Close
Set rs = Nothing
Set objConn = Nothing
%>
</select>
<tr>
<td class=font><p> <b>Reply Message</b>
<textarea name="txtRespMessage" size=8000 rows="8" cols="40" wrap="VIRTUAL" scrolling="yes" value="<%= request.form("txtRespMessage")%>"></textarea>
<script type="text/javascript">
function SelectCResponse(theForm)
{
theForm.txtRespMessage.value = "write something here"
}