Forums

This topic is locked

Dynamic text associated with Dropdown menu

Posted 03 Apr 2003 19:10:14
1
has voted
03 Apr 2003 19:10:14 gecko Deep posted:
Hello there
I wondered if any one could help me with this problem,
i am trying to display a dynamic text pulled from a record set which is from a table called Department.
Actually i have two tables one called SITE and the other DEPARTMENT in the SITE table i have the name of the sites and the DEPARTMENT_ID which is from the DEPARTMENT table, I have made a recordset which pulls all the sites from the SITE table and display it through Dropdown list menu, which works fine. What i wish to do though is to be able to display dynamically without refreshing the page to display the DEPARTMENT name adjacent to the dropdown list menu, lets say for example if i choose UK from the dropdown menu the text next to the menu should change dynamically to Accounts and so on without refreshing the page.
I am building the site with the aid of Dreamweaver MX and SQL2000.
I'd appreciate if some one could shed some light on this.

Thanks in advance
GD

Replies

Replied 04 Apr 2003 09:08:38
04 Apr 2003 09:08:38 Julio Taylor replied:
as far as i know, there is no easy way of doing it without page refreshes.... the database is queried by using GET or POST vars (in the SQL window, ASP/PHP uses URL/FORM variables to query a database) and i don't think it is possible to change these variables dynamically without refresh.

i suppose you could maybe try to programmatically alter the value of the GET variable depending on the option chosen on the drop menu - however i don't know how you can affect the output of the query, since the SQL query is executed as the page loads.... maybe someone with more JS experience can tell you a way to maybe call a function on a 'OnChange' event.

------------------------
Julio

PHP | MySQL | DWMX

ICQ: 19735247
MSN:
Replied 04 Apr 2003 09:56:04
04 Apr 2003 09:56:04 Vince Baker replied:
THis can be done client side using javascript. click on this link to get the information and code you need. I use this code a lot and the guide is very good:

www.macromedia.com/support/ultradev/ts/documents/client_dynamic_listbox.htm

Regards
Vince

Visit my home: www.chez-vince.com

VBScript | ASP | HTML | SQL | Oracle | Hosting

Reply to this topic