Help on db input to innerHTML after cbo_onupdate()

Hi.
On an .asp page, after an user has changed the selected value in a combo box
(cboMyDistricts) I want the text in a textarea on the same page to change.
The text is retrieved from a recordset based on the cboMyDistricts value.

I know I can reload the same page with a input variable, but would really
like to do it through DHTML instead.

Can I through .js script change the innerHTML text on a text area, based on
certain record in a recordset?

Psaudo like this:

<script>
function updtMyTextarea()
Document.MyTextarea.innterHTML =
MyRecordset(Document.cboMyDistricts.value)
//I know this does not work at all combining .asp and srcipt. But it
might give a hint on what I try to do....
end function
</script>
MyRecorset = dbConn.execute("SELECT txtDistrictText FROM tblDistricts ORDER
BY iDistrictID")

<SELECT id= cboMyDistricts name=cboMyDistricts onchange="updtMyTextarea()">
<option value =1>District 1</option>
<option value =2>District 2</option>
<option value =3>District 3</option>
......
</SELECT>

<TEXTAREA id=MyTextarea name = MyTextarea></TEXTAREA>


If some of you understand my issue or have more general tips on changing
text/content "on the fly" rather than by reloading the page, I'll be
intrested. I think some kind of array() keeping all the district text might
be a solution, but not quite sure how and where to populate the array, and
use it as a input to a innterHTML statement.

Please anyone.

Kind regards
Mr. Smith
nospam [ Do, 02 Februar 2006 09:18 ] [ ID #1170303 ]

Re: Help on db input to innerHTML after cbo_onupdate()

You should look in to using the XMLHTTP object.

See:- http://jibbering.com/2002/4/httprequest.html

You can use this to post a small request to the server containing just the
values you need and you can then
assign the response to the text area's innerText.

Anthony.
Anthony Jones [ Do, 02 Februar 2006 10:43 ] [ ID #1170306 ]
Webserver » microsoft.public.inetserver.asp.db » Help on db input to innerHTML after cbo_onupdate()

Vorheriges Thema: Updating multiple rows in form still a problem
Nächstes Thema: how to get the record with paramater query in access