SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
-
Jun 2, 2007, 05:10 #1
- Join Date
- Jan 2006
- Posts
- 9
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Passing PHP between forms on same page
Many thanks in advance to all who offer help.
Yep, yet another newbie question. So new to php it is causing a real headache
On my webpage i currently have two drop down boxes for user selected options where the selection comes from different MySql tables. The first box display ok, without any issue, but the second will not as when the page is first loaded, the variable being used to define the selection is blank as the first box has not been chosen.
How to refresh the page or do whatever is necessary, so that when the user choses their selection form the first drop down, then that choice can be used to define the WHERE element of the mysql query.
-
Jun 2, 2007, 05:16 #2
- Join Date
- Apr 2007
- Location
- Pakistan
- Posts
- 102
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
You can use javascript event onchange on the first dropdown to submit the values on the same page. And you should query for the 2nd dropdown only when the value is provided.
-
Jun 2, 2007, 08:33 #3
- Join Date
- Apr 2006
- Location
- Pennsylvania
- Posts
- 1,736
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Or you can use AJAX. When the first dropdown is changed, retrieve the values for the second dropdown through AJAX. You'll need to do a lot of reading and studying for that one though if you've not studied it yet.
-
Jun 2, 2007, 10:50 #4
- Join Date
- Aug 2005
- Posts
- 453
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Does this code help:Plus2net:
Computers and Fire ...
In the hands of the inexperienced or uneducated,
the results can be disastrous.
While the professional can tame, master even conquer.
Bookmarks