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
