/    Sign up×
Community /Pin to ProfileBookmark

how use a listbox for select items beetween 3 lists?

hi,
i want select 3 categories using 3 listboxes
like this picture show

how can i do that?

thanks for your help ?

to post a comment
HTML

7 Comments(s)

Copy linkTweet thisAlerts:
@MindzaiNov 28.2008 — I'm assuming you mean each <select> would be updated based on the value selected in the one before. In this case it is usually done these days using AJAX, the server side component of which is usually something like a PHP script which returns the values corresponding to the previous selection. You can do this relatively easily using jQuery or another framework with AJAX functions (or youcould write your own but in all honestly there's not much point when it's been done for you already).
Copy linkTweet thisAlerts:
@jasonx22authorNov 28.2008 — hi,

yes is thats what i want i have searched for examples but without sucess

can you point some samples?

thanks a lot for your help
Copy linkTweet thisAlerts:
@MindzaiNov 28.2008 — Well I don't know which scripting language you intend to use on your server, or where the information is coming from to populate the list boxes, so it's hard to give you any pointers on that side of things, but a good place to start would be the jQuery AJAX documentation. I would recommend jQuery for handling the client side of your program because it has built in functionality for everything you will need to do.
Copy linkTweet thisAlerts:
@jasonx22authorNov 28.2008 — i using php and the list info is stored in a mysql db

thanks
Copy linkTweet thisAlerts:
@javawebdogNov 30.2008 — Let's assume (just for fun) that AJAX is not an option for you ;-)

For the first select set an onchange event that calls a javascript function that builds/populates the second select, which in turn calls another javascript function that in turn builds/populates the third. The data for each could be a set of arrays. Wholly client-side and admittedly very old school.

Saw an example on a German domain site: http://www.fh54.de/js/cascadingselects/

Another at http://webdeveloper.earthweb.com/webjs/jsnavigation/item.php/91311
Copy linkTweet thisAlerts:
@jasonx22authorNov 30.2008 — hi the samples works fine but i looking for a listbox not a combo list the way is the same? thanks
Copy linkTweet thisAlerts:
@javawebdogNov 30.2008 — Same problem. The difference between a combo box and list box is the size attribute.

Typically combo are <select size="1"> if no size is supplied "1" is the default. A list box is just a select where the size=>the number of expected items.

That said the since they both use the same html elements they have the same behaviors and constraints.
×

Success!

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