Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

select option onchange --> write value to text area ?

Status
Not open for further replies.

stonehead

Technical User
May 2, 2007
58
US
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>&nbsp <%= left(rs("Description"), 20)%>...</option>

<%
RS.MoveNext
WEnd

rs.Close
objConn.Close
Set rs = Nothing
Set objConn = Nothing
%>
</select>

<tr>
<td class=font><p>&nbsp;<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"
}

 
try forum216

____________ signature below ______________
The worst mistake you'll ever make is to do something simply the way you know how while ignoring the way it should be done
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top