User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 456,485 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,793 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 871 | Replies: 1
Reply
Join Date: Aug 2007
Posts: 8
Reputation: bg370 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
bg370 bg370 is offline Offline
Newbie Poster

JS Dropdowns

  #1  
Sep 13th, 2007
I've been doing PHP for a while and am starting up on Javascript. Here is what I'd like to do:

I need to set up a series of dropdowns. I'd like the first one to be the only one in existence at first. Then, depending on what is selected, I'd like to create the second one and populate it based on what was selected in the first one etc. What is the best way to do this? I assume an OnChange event would be used to trigger a function that creates the new dropdown. How do you actually create a dropdown using JS?
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jun 2006
Location: India
Posts: 7,012
Reputation: ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold 
Rep Power: 25
Solved Threads: 368
Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Lazy, Useless & Apathetic

Re: JS Dropdowns

  #2  
Sep 14th, 2007
Look into the document.createElement() function which creates new DOM elements based on the passed parameter. Also look into the DOM select and DOM option objects.
I don't accept change. I don't deserve to live.

Happiness corrupts people.

Failing to value the lives of others cheapens your own.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb JavaScript / DHTML / AJAX Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 3:02 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC