• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

VB / SQL Help ... Populate text box

santana9

Banned
Ok, I have a drop down list that is populated with the client's first and last name from the database. What I want is to have the preceding text box's such as their title, email, address, etc. (other columns in the table) to change when a user selects the approriate name.

I am able to get the client information to work, but am unable to change the info. Here is my some of the code:

strSQL3= "Select * from Client where Client.Last_Name like '%" & url & "%'"

<SCRIPT LANGUAGE="JavaScript">
<!--
function menu_goto(menuform)
{
selecteditem = menuform.requested_by.selectedIndex;
url = menuform.requested_by.options[selecteditem].value;
if (url.length != 0)
{
location.href = url;
}
}

//-->
</SCRIPT>

<SELECT size=1 name=requested_by onchange="menu_goto(this.form)">
<%
rstSearch2.Open strSQL2, Conn, adOpenKeyset, adLockOptimistic, adCmdText
do while not rstSearch2.EOF
%>
<option><%=rstsearch2.fields("LAST_NAME").value%></option>
<%rstSearch2.movenext
loop
rstSearch2.close
set rstSearch2 = nothing
response.flush
%>

<INPUT type="text" name=ctitle value="<%= Server.HTMLEncode(rstSearch3.Fields("ctitle").Value) %>" size="25">

LMK if you need any more information. Thanks in advance.
 
First of all, to be able to read .value property of a selected index it has to exist!!! 🙂
Look carefully at your <option> tag, THERE IS NO value specified. You'd have to have: <option value="<%=rstsearch2("TITLE") & ", " & rstsearch2("EMAIL") & ", " & rstsearch2("ADDRESS")%>"><%=rstsearch2.fields("LAST_NAME").value%></option>
Good luck
 
Back
Top