Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

About menu in the form

Status
Not open for further replies.

Geminist

Programmer
Jul 6, 2002
25
CN
Hi,need your help!
Suppose there are two menu lists in a form called A and B.How can I get this?When I select an item in A,a query is submitted to mysql and the result is displayed in B?
 
Can you please be more specific? A form is submitted via POST or GET and the data is available as an array on the new page.

Or do you want to be more dynamic? With javascript or so?
Everytime A is changed you want to query the database? mcvdmvs
"It never hurts to help" -- Eek the Cat
 
I want to show a dynamic page.Every time A is changed,database is queried and B is changed.All happen without form actions.
 
You can't.

PHP run server side so, if you want to change B according to A, you must do a refresh, or, fill B with Javascript. Javascript is a client side language.

To do a fill with JS, you must load everything in B to the JS, and then, when you pick the value from A, you fill B with the data you already got from the load of the page. That's not a good policy. The best way is changing A, you do a form submit and then you fill B.


Anikin
Hugo Alexandre Dias
Web-Programmer
anikin_jedi@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top