/    Sign up×
Community /Pin to ProfileBookmark

Create dynamic fields based upon drop down selection

hi,

I need to create fields which appear when a person selects an option from a drop down field.

For example, if the user selects option 1 from the drop down it creates 3 text fields and 1 drop down box which dynamically appear……OR…..if the user selects option 2, it creates 1 text field, 1 checkbox and 1 drop down.

How can i achieve this using javascript and html ? Is it even possible?

Please help ASAP.

Thanks,

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@KravvitzOct 25.2006 — It's possible. Do you really want to make people use a browser with JavaScript enabled to use your form?

I suggest you read these:

[url=http://developer.yahoo.com/yui/articles/gbs/gbs.html]Graded Browser Support[/url]

[url=http://www.webmonkey.com/03/21/index3a.html]Progressive Enhancement and the Future of Web Design[/url]

[url=http://www.robertnyman.com/2006/10/10/accessibility-is-seldom-just-up-to-the-interface-developer/]Accessibility is seldom just up to the interface developer[/url]

To do this you will need to know about the Document Object Model (DOM):

[url=http://www.sitepoint.com/article/rough-guide-dom/]Rough Guide to the DOM[/url]

[url=http://www.howtocreate.co.uk/tutorials/javascript/domintroduction]JavaScript tutorial - W3C DOM introduction[/url]

http://www.quirksmode.org/dom/

http://www.quirksmode.org/js/dom.html

http://www.brainjar.com/

http://developer.apple.com/internet/webcontent/dom2i.html

http://developer.mozilla.org/en/docs/DOM:document

http://developer.mozilla.org/en/docs/Gecko_DOM_Reference

http://digital-web.com/articles/forms_usability_and_the_w3c_dom/

http://www.w3.org/DOM/

Doing this is complicated. This is not something you can learn over-night. If you're in a hurry, then you might want to consider hiring someone to do it for you.
×

Success!

Help @ticket65 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 4.29,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...