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!

Changing Text

Status
Not open for further replies.

zzfive03

Programmer
Jun 11, 2001
267
Hello,

I have a pulldown menu with several DB loaded values. When the user selects an option, I want that options value to appear somewhere else on the page as regular text. I know how to pass the desired value to a VBScript funciton, but how do i make it display on the page?

Do i put it in a <div>? If so, is there a text or content field?

Anyone who can help, i will be greatly appreciated.
Thanks, MH
 
depending on the length of the content that is going to be shown the first thing I would try and the simple way is to simply have a form field palced in the page and populate it on the selection.
make the form field appear as though it was not with style like this
<input type=&quot;text&quot; name=&quot;txtFrmDBSelect&quot; style=&quot;border:none;background-color:#FFFFFF&quot;>

then jsut do a little conditioning in the select with a onSelect or other event and on that selection and fill the form value.

A language that doesn't affect the way you think about programming is not worth knowing.
admin@onpntwebdesigns.com
 
zzfive03,
I know this is a vbscript forum but here's a version of javascript that should work.

fenghsui_1998


<form name=&quot;thisform&quot;>
<select name=&quot;srt&quot; onchange=&quot;dothis()&quot;>
<option value='1'>1</option>
<option value='2'>2</option>
<option value='3'>3</option>
</select>

<input type=&quot;text&quot; name=&quot;results&quot;>

</body>

<script language=&quot;javascript&quot;>
function dothis() {
var val = document.thisform.srt.options[document.thisform.srt.selectedIndex].value
document.thisform.results.value = val
}
</script>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top