Click to See Complete Forum and Search --> : autofill a drop down menu with js


redbrad0
03-08-2003, 06:08 PM
I have a drop down menu that is autofilled by Javascript, the only problem is the value of the drop down menu is the same as the displayed name. I am pulling this information out of the database and want to know if anyone has any code that will populate the value as one value and the text as another. Here is a URL where you can see what I am doing...

http://www.eznetideas.com/auto/auto_search.asp

When you select the car make, it displays all the models of that make. The URL to the javascript file is located at...

http://www.eznetideas.com/auto/autosearch.js

Can someone point me to some sample code, or help show me how to fix this?

Thanks,
Brad

khalidali63
03-08-2003, 06:14 PM
May be this can help you..take a look

http://68.145.35.86/skills/javascripts/MultipleListBoxResult3rdListBox.html

Cheers

Khalid

pyro
03-08-2003, 06:18 PM
If you are using ASP to pull the values from a database, why use javascript at all? Why not make a new field in the database, and use ASP to fill it in something like this:

<option value="<%=DatabaseVal%>"><%=DatabaseVal2%></option>

Note: the syntax may be wrong, as I don't know ASP, but that should show what I mean.

redbrad0
03-08-2003, 06:22 PM
well the reason not to use just asp is so that it autofills the models and does not have to refresh the webpage.