www.brainchildhunter.net


Fw: [PHP_MySQL] Re: Help with SELECT LIST OPTION

Let me draw up a scenario and see if this is correct (using letters as placeholders for the real options). On the first page, you have a dropdown for choosing trades. I select option 'A', hit submit. I'm now on the second page with the region dropdown. The available options are: 'All Regions', 'X', 'Y', and 'Z'. If I select 'X' and hit submit, it will give me the list of users from region X. If instead I selected 'All Regions' and hit submit, it will give me the list of users from region X, Y, and Z. Second scenario. On the trades page, if I had selected a different option, 'B', and hit submit, I will see different region options 'All Regions', 'Q', 'R', 'S'. Does that seem correct? If so, then I see where you can have a problem. Selecting 'All Regions' from the first scenario versus the second scenario gives no real information to the code that generates the list of users. In this case, 'All Regions' does not mean ALL regions, it just means 'give me a list of users from regions X, Y, and Z' in the first scenario and 'give me different list of users from regions Q, R, and S' from the second scenario; yet, you're passing the same form value 'All Regions.' What I would suggest is that instead of using a dropdown, use checkboxes instead. Generate the HTML to become: ----- Region X Region Y Region Z ----- There's a few benefits using this. First, you give the user more control over what she wants to view. If she wants to see regions Y and Z, she'll check on Y and Z. If she wants to see them all, she can check them all. Second, from a design standpoint, you won't confuse the user to what 'All Regions' really means, because it means something different based on the trade selected. Third, it's much smoother when you receive the data through the query string (URL). You're getting it as an array. On the last page, you can use an IN clause on your query to get the results. I'm not sure how your tables are set up but this is an example of how an IN clause would work. ----- SELECT firstName, lastName FROM user WHERE region IN ('X', 'Y') ----- Does this help? I hope I understood your question correctly. Let me know if you have any questions. Zeo out. < --- In "Liz" wrote: > > Thanks, Zeo...yes, I am using MySQL to populate the REGION select list. How do I hardcode an option for ALL REGIONS within the filtered list? > > When they use the REGION select list, they invoke a select based on the previous selection - TRADE. Depending on which TRADEis selected (not all TRADES exist in all REGIONS), there may be 1 to 7 REGIONS on the drop down select list. These two parameters, the selected TRADE & selected REGION, are passed to the query and the data result presented to the visitor. > > I hope that is helpful! > > Liz > > > > > Let me just make sure I have your question correct. You're using > MySQL to populate the form options, but you want to add another option > for All Regions. You can always hardcode any option you want before > or after the while loop, such as: > > echo "All an option > > while($row > }} > > Let me know if this helps. > > Zeo out. < > > > [Non-text portions of this message have been returnd] > Come to the monthly meetings at UTD in Richardson, TX. Second Tuesday of every month.Yahoo! Groups Links To visit your group on the web, go to: Your shop settings: Individual shop | Traditional To change settings online go to: (Yahoo! ID required) To change settings via shop: To Purchase from this group, send an shop to: Your use of Yahoo! Groups is subject to:

... Back to listing 36

... Back to article 7034 | SITEMAP | Next to article 7036 ...


We would like to express our gratitude to all those who are kindly providing this unique content, especially to:

office@a3ides.com
olga@bemobile.md
tirlik@brainchildhunter.com
office@bemobile.md
sharuha@causeni.info
info@webconsulting.md
irina.gorea@bemobile.md
office@milieukontakt.nl
igor.romanyuk@bemobile.com.ua
yuri.sekretar@olympia.net.ua
info@tophost.md
webmoldova@yahoo.com
admin@bemobile.md
webmaster@bemobile.md
emil@a3ides.com
olea@bemobile.md
yuri.sekretar@bemobile.com.ua
contact@a3ides.com
info@a3ides.com
vitaliy.lozovskiy@bemobile.md
drugg83@yahoo.com
flaviu.mateevici@gmail.com
flaviu@dataverity.com
rector@usm.md
gaugash@usm.md
acad.rudic@mail.md
acadrudic@yahoo.com
veaceslav.vasilache@gmail.com
s.bakker@milieukontakt.nl
katea.melnicenco@gmail.com
mkoe.moldova@vox.md
musteata@doctor.com
renat.buga@ase.md
s.molenkamp@milieukontakt.nl
si_problemme@mail.ru
willem.tjebbe.oostenbrink@planet.nl
Most popular links:

selected, scenario, different, Regions', regions, submit,, Regions',, populate, options, instead, settings, question, hardcode, REGIONS,

Similar listing on: