Click to See Complete Forum and Search --> : edit box
swstos
03-25-2003, 08:33 PM
hi...
simple question
I have a drop down box and 2 edit boxes. Lets say that the drop down box takes values from the database and displays regno of cars. Is it possible depending the regno from the drop down box in the other 2 edit boxes will display the colour and the company of the car???
my problem is that i can display values in the drop down box but i dont know how to display them in the edit boxes?
Can anyone please help me.
swstos
03-25-2003, 08:47 PM
the drop down box shows only the car registration number and depending from what the registration number will be selected the colour and the company of the car will be displayed in the edit boxes. is that possible???
swstos
03-25-2003, 09:04 PM
sorry for not saying exactly what i want to do
dropdownbox code:
<SELECT name=regno LANGUAGE=javascript onchange= "">
<%
strSQL = "Select carregno FROM car "
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.open strSQL, adoCon
DO WHILE NOT objRS.EOF
if Request.Form("regno") = objRS("carregno") then 'if this is the selected one then display as selected
Response.Write "<OPTION VALUE = '" & objRS ("carregno") & "' SELECTED>"
Response.Write objRS("carregno") & "</Option>"
objRS.MoveNext
else
Response.Write "<OPTION VALUE = '" & objRS ("carregno") & "'>"
Response.Write objRS("carregno") & "</Option>"
objRS.MoveNext
end if
loop
set objRS = nothing
%>
</select>
now by selecting e.g. carregno = abc123 the colour that is stored to the table is red and company name is fiat. how can those be displayed in the edit boxes?
Thanks for the help.
swstos
03-26-2003, 08:49 AM
in the database there is a table called car
it has 3 attributes: carregno, colour and companyname
retrieve all the carregno into the dropdownbox useing the code in the previous post.
by selecting a carregno from the dropdown box in the edit boxes it will display the colour and the companyname of the specific car... those values are in the database.
how can i do that???
Thanks in advance.