/    Sign up×
Community /Pin to ProfileBookmark

autofill a drop down menu with js

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…

[url]http://www.eznetideas.com/auto/auto_search.asp[/url]

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

[url]http://www.eznetideas.com/auto/autosearch.js[/url]

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

Thanks,
Brad

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@pyroMar 09.2003 — 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.
Copy linkTweet thisAlerts:
@redbrad0authorMar 09.2003 — well the reason not to use just asp is so that it autofills the models and does not have to refresh the webpage.
×

Success!

Help @redbrad0 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.7,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...