/    Sign up×
Community /Pin to ProfileBookmark

Dynamic drop down select lists

hello,
i am trying to extend one of this sites scripts, [url]http://javascript.internet.com/forms/country.html#source,[/url] which would allow me to basically make my forms a bit more neater.

anyhow, the way i am extending this is by “generating” all my data from the database which stores all the demographic data, such as the country, region etc… and i am pulling all this using a python script.

now what i can’t for the life of me figure out, is how to pass the selected items i.e the value, once the user has made their selection to my action=”process_this_form” method.

the java example, only lists the region value, but i am more intrested in recording country that the user is from once the form is submitted?

#####form########
<form name=”globe”>
<select name=”region” onChange=”populateCountry(document.globe,document.globe.region.options[document.globe.region.selectedIndex].value)”>
<option selected value=”>Select Region</option>
<option value=’asia’>Asia</option>
<option value=’africa’>Africa</option>
<option value=’australia’>Australia</option>
<option value=’europe’>Europe</option>
<option value=’middleeast’>Middle East</option>
<option value=’lamerica’>Latin America</option>
<option value=’namerica’>North America</option>
<option value=’samerica’>South America</option>
</select>
<select name=”country” onChange=”populateUSstate(document.globe,document.globe.country.options[document.globe.country.selectedIndex].text)”>
<option value=”><——————–</option>
</select>
</form>

####endform####

many thanks

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

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