drop down menu based on form input

hi...

I am developing an application using PHP/MySQL.

here, i have one page(say P1), which contains a form(just one drop down menu, say D1, with only 2 options , say O1 and O2)...

the target of P1 is another page, say P2.

Now, P2 is also a form, and contains a number of fields (all text fields)...

THE PROBLEM

P2 also contains a drop down menu.
Now, this is not a static drop down menu.

If, on P1, the user selectes O1, then a particular drop down menu is displayed on P2.(say D2)

If, on P1, the user selects O2, then another drop down menu is shown (say D3)

Both D2 and D3 are different from D1.

I have coded this, but it shows me errors. I guess i may be mixing HTML and PHP code at some place, but am unable to figure it out... pls help me out if u can...

I am posting the code i developed...


THE CODE


P1.php


P2.php

 


Name: ID: } else { Test : } ?>

please help me out...

thx...

Replies

  • hbk
    hbk
    one possible solution to this is:

    If on P1, the user selects O1, i direct him to page Pa.php, which contains the drop down menu D2.

    Instead, If on P1, the user selects O2, i direct him to page Pb.php, which contains the drop down menu D3.

    though this is a possible solution, it also involves a problem.

    Here, i will have to dynamically decide the target of my page P1, depending on whether the user chooses O1 or O2.

    I have searched this. It is possible using javascript, but i havent found a solution to this using PHP.

    So if anybody could please explani this, i would be really grateful...

    thx a ton ...

You are reading an archived discussion.

Related Posts

hey guys. this may be very trivial, but i cant figure out a way... i want to retrieve the data entered by the user through a drop-down-menu using POST method....
hi frnds. this is something which may seem foolish to ask, but i have been beating my head against the wall at the frustration of not being able to get...
Hello thar! My name is Tyler, and I'm a 15 year old female who plans on majoring in electrical engineering at Louisiana Tech. I joined this forum to gain information...
Im currently doing my final year project which is the intelligent grounding system... But im not sure abt certain parts of my project, and i cant ask my advisor too...
Is June designated to be a wedding season? I had to attend a couple last week (which accounts for my hiatus from CE), and knew about half a dozen more....