/    Sign up×
Community /Pin to ProfileBookmark

Dynamic Dropdowns Default Values?

I’ve build an application that offers a drop down box with choices generated from a database using asp. Making a choice in the first box populates a second box with additional appropriate choices. That’s all working fine but I want the user to be able to recall previously made choices for subsequent editing. I’ve managed to get the first box to show the value selected in a previous session but I can’t figure out how to get the code dynamically written for the second box to show one value as selected. Here’s a snippet of code that writes the code for the second box. If someone could suggest how I modify this to allow me to make one value selected based upon an asp if/then test, I’d greatly appreciate it. Thanks!

sJavaScript = sJavaScript & _
“document.f1.RealtyLName.options[document.” & _
“f1.RealtyLName.options.length] = new Option(‘” & _
junk & “‘,'” & rs02(“RealtyLNameID”) & _
“‘);” & _
vbCrlf

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @stonehousegroup 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.18,
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,
)...