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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HOW TO RETRIEVE DATA FIELDS INTO TEXT BOX VIA SELECT BOX

Status
Not open for further replies.

Coding

Programmer
Aug 13, 2000
25
0
0
CA
Does anyone know how to retrieve information from database by selecting options from select box. This code works if I put value=&quot;John&quot; instead of<%=rsUserInfo(&quot;usr_firstName&quot;)%> as option value.
I actually need to fit this code to the application which will email the content of the textarea to users. Each user should get his unique information like: name, address, email, username, etc...
Here is the code.
Thanks.

...

function selectItem()
{

document.the_form.the_area.value += &quot; &quot; + <%_%>
the_form.the_selectbox.options[the_form.the_selectbox.selectedIndex].value;

}

...

<form name=&quot;the_form&quot; method=&quot;post&quot; >

<select name=&quot;the_selectbox&quot; onChange=&quot;selectItem();&quot;>

<option value=&quot;<%=rsUserInfo(&quot;usr_firstName&quot;)%>&quot;>First Name
<option value=&quot;<%=rsUserInfo(&quot;usr_lastName&quot;)%>&quot;>Last Name
<option value=&quot;<%=rsUserInfo(&quot;usr_address&quot;)%>&quot;>Address

</select>

<textarea rows=&quot;15&quot; cols=&quot;60&quot; name=&quot;the_area&quot;></textarea>

</form>

...
 
you have to write the rs to the page
<option value=&quot;<%=Response.Write rsUserInfo(&quot;usr_firstName&quot;)%>&quot;>First Name A language that doesn't affect the way you think about programming is not worth knowing.
admin@onpntwebdesigns.com
 
Try using single quotes around your value, e.g.:
<option value='<%=rsUserInfo(&quot;usr_firstName&quot;)%>'>First Name Hope this helps.
Ciao, K----------------
&quot;If you were supposed to understand it, we wouldn't call it code&quot; - FedEx
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top