Why Is This Pull Down Menu Displayed In The Opposite Directi

HTML, CSS and anything else that deals with client side capabilities.

Moderator: General Moderators

Post Reply
drayarms
Forum Contributor
Posts: 134
Joined: Fri Dec 31, 2010 5:11 pm

Why Is This Pull Down Menu Displayed In The Opposite Directi

Post by drayarms »

I'm trying to create this form with three pull down menus. The first pull down menu has the heading "Seeking A" with options "Man" and "Woman". The second and third pull down menus age ranges from 18 to 99 years. Everything works ok, except that the age pull down menus display the ages upwards instead of downwards as should be expected. What could possibly be the problem. I have the form displayed below.

Code: Select all

<form id="search_profiles_form" action= "profile_search.php">
02
 
03
 
04
 
05
 
06
 
07
                            Seeking A:
08
                            <select name= "sex">
09
                                <option value= "man">Man</option>
10
                                <option value= "woman">Woman</option>
11
                                <option value= "both">Both</option>
12
                            <select>  
13
 
14
 
15
                            <p> <tab> Age Range: <?php
16
                            print '<select name= "min_age">';
17
                            for ($age = 18; $age <= 99; $age++) {
18
                                print "\n<option value=\"$age\">$age</option>";
19
                            }
20
                            print '</select>'; ?> </tab>
21
 
22
                            <tab> and: <?php
23
                            print '<select name= "max_age">';
24
                            for ($age = 18; $age <= 99; $age++) {
25
                                print "\n<option value=\"$age\">$age</option>";
26
                            }
27
                            print '</select>'; ?> </tab> </p>
28
 
29
</form>

User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: Why Is This Pull Down Menu Displayed In The Opposite Dir

Post by califdon »

for ($age = 18; $age <= 99; $age++) {
You are starting with 18, so that's at the top, and incrementing $age until it reaches 99, which is at the bottom. If that is not what you want, you can start at 99 and decrement $age until it reaches 18. I guess I don't understand what you want.
drayarms
Forum Contributor
Posts: 134
Joined: Fri Dec 31, 2010 5:11 pm

Re: Why Is This Pull Down Menu Displayed In The Opposite Dir

Post by drayarms »

@califdon, You probably didn't understand me. What I meant was when I click the little arrow to display the pull down menu, the column holding the contents of the menu are displayed above instead of below the input box. So I get a pull up (if there is any such phrase) menu instead of a pull down menu. Hope that better explains it.
User avatar
McInfo
DevNet Resident
Posts: 1532
Joined: Wed Apr 01, 2009 1:31 pm

Re: Why Is This Pull Down Menu Displayed In The Opposite Dir

Post by McInfo »

That is normal behavior for menus that are close to the bottom of the screen.
Post Reply