General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old June 4th, 2003, 04:53 AM
markrenn markrenn is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 23 markrenn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
multiple select intelligent array

I need help on this multiple select script,
=================
PHP Code:
<select name='Country[]' multiple>
   <
option value='All' selected>All Regions</option>
    <
option value='Asia'>Asia</option>
    <
option value='Europe'>Europe</option>
    <
option value='North America'>North America</option>
    <
option value='China'>China</option>
    <
option value='France'>France</option>
    <
option value='Canada'>Canada</option>
    <
option value='Japan'>Japan</option>
    <
option value='Germany'>Germany</option>
    <
option value='Mexico'>Mexico</option>
    <
option value='Brazil'>Brazil</option>
    <
option value='New Zealand'>New Zealand</option>
</
select


i want to put the selections of the users from this form in an array, but i want it to be intelligent such that when I select "Asia, Japan, Europe and Canada", my array will contain [China, Japan, France, Germany, Canada] or if I select All Regions, all the countries in the selection will be selected.

Last edited by markrenn : June 4th, 2003 at 04:56 AM.

Reply With Quote
  #2  
Old June 4th, 2003, 08:29 AM
Taelo Taelo is offline
5B's
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: PC, FL
Posts: 364 Taelo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 48 m 26 sec
Reputation Power: 6
well,....whatever you select should be contained in the $Country array. not sure what you want to do with it after that though.
__________________
-- Jason

Reply With Quote
  #3  
Old June 4th, 2003, 08:21 PM
markrenn markrenn is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 23 markrenn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
hi taelo,

what i would like to do is for the array to filter its content such that when i select asia, it woul automatically include all countries in asia, if I select asia and japan,
it will still include all countries in asia but not duplicating japan as an element in the selection. i would also like to filter the array so that the names of the continents will not be included, only the countries in that selected continent.

hope to get your comments and answers soon

Reply With Quote
  #4  
Old June 4th, 2003, 08:41 PM
Taelo Taelo is offline
5B's
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: PC, FL
Posts: 364 Taelo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 48 m 26 sec
Reputation Power: 6
well I am assuming you are retrieving this information from a database? I would make an association between a continent and a country. then you can retrieve the information very easily.

make sense?

Reply With Quote
  #5  
Old June 4th, 2003, 09:55 PM
markrenn markrenn is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 23 markrenn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
well,,,, here's what i did. i placed all asian countries in asia_array, european countries in europe_array and north american countries in namerica_array. then i compared the post to each array i have. if asia is selected in the post and there is also another country in the post that match asia_array, all countries in asia_array will be included in the selection without making duplicates of the asian countries in the post

Reply With Quote
  #6  
Old June 4th, 2003, 10:16 PM
Taelo Taelo is offline
5B's
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: PC, FL
Posts: 364 Taelo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 48 m 26 sec
Reputation Power: 6
good deal, glad to hear you solved your problem

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > multiple select intelligent array


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway