Why Is This Pull Down Menu Displayed In The Opposite Direction.

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.[php]

02

03

04

05

06

07
Seeking A:
08

09
Man
10
Woman
11
Both
12

13

14

15

Age Range: <?php
16
print ‘’;
17
for ($age = 18; $age <= 99; $age++) {
18
print “\n<option value=”$age">$age";
19
}
20
print ‘’; ?>
21

22
and: <?php
23
print ‘’;
24
for ($age = 18; $age <= 99; $age++) {
25
print “\n<option value=”$age">$age";
26
}
27
print ‘’; ?>


28

29

[/php]

Is this what you want?

[php]
Seeking A:

Man
Woman
Both

Age Range: <?php
print ‘’;
for ($age = 18; $age <= 99; $age++) {
print “\n<option value=”$age">$age";
}
print ‘’; ?>

                        <tab> and: <?php
                        print '<select name= "max_age">';
                        for ($age = 99; $age >= 18; $age--) {
                            print "\n<option value=\"$age\">$age</option>";
                        }
                        print '</select>'; ?> </tab> </p>

[/php]

@sarthekpatel, 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.

Well, i tried to run it and for me it’s working fine…!! I’m getting a pull down menu. Can u attach a screenshot or something?

What is happening I think is that your form on your page is so close to the bottom of the browser window, because it cannot list the numbers down, due to space restrictions. It extends upwards aswell.

You would have to find a way to do it in javascript as it is built into browsers.

Sponsor our Newsletter | Privacy Policy | Terms of Service