drop down to create drop down.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
gammaman
Forum Commoner
Posts: 45
Joined: Tue Feb 12, 2008 9:22 am

drop down to create drop down.

Post by gammaman »

How can I have a drop that list that when a choice is made exectes php server self. Then based on what is posted back, another drop down appears in place of the first. I need to keep the values of both drop downs to send to another page later.

See I have this query to select contract #'s. They are put into the first drop down. I then want to do php self, hide the first drop down, but keep the value.
I then need a second drop down which will store another query result of item numbers based on the first drop down value. After selecting the item number
I want to send both values to another page to produce a result query.
jraede
Forum Contributor
Posts: 254
Joined: Tue Feb 16, 2010 5:39 pm

Re: drop down to create drop down.

Post by jraede »

Add a check to see if there's a POST or GET request at the top...if yes, then render a form that posts to your next page, a hidden text field with the value of the first dropdown, and then another dropdown based on that value. If no, then just display the first drop down within a form that posts back to itself.

You may also want to consider using AJAX for this.
Post Reply