CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 dependent listbox without javascript arrays - php

Print topic Send  topic

Author Message
Tomasz
Posted: 05/28/2002, 10:50 AM

My page displays flats details. My db have 3 db tables:

- localizations (loc_id, loc_name)
- buildings (b_id, b_loc_id, b_name)
- flats (f_id, f_loc_id, f_b_id, f_name)

E.g. page is opened for editing with parameter:

page.php?f_id=1

and displays flat no. 1 with specific data. Names of localizations and buildins are taken from their tables and put into listboxes. Source of second listbox is custom SQL with condition: it displays only buildings from choosen localization.

I wrote javasript for tracing onchange for first listbox (localization). When user choose something different, page refreshes and choosen value is used as a condition for SQL source for second listbox. It works.

Problem is that first listbox still shows old value (becouse form still displays db record no. 1, I suppose)

Does anybody has an idea how to fix it?
Andrew B
Posted: 05/28/2002, 4:24 PM

Could you walk through that again, with the steps taken outlined, the dependencies, and such?

I don't see why it shouldn't work. You konw which one you selected, since you passed it in, so why not just use that value to determine the selected item?
Nicole
Posted: 05/29/2002, 12:41 AM

Tomasz,
please elaborate your problem. What do you want to be displayed in localization listbox (I suppose it is "first listbox" as you said) after you've selected any value in it and after page is refreshed?
Tomasz
Posted: 05/29/2002, 5:55 AM

example:

table localizations:
(loc_id, loc_name)
1, 5th ave
2, Broadway

table buildings:
(b_id, b_loc_id, b_name)
1, 1, big tower
2, 1, small tower
3, 2, big hall
4, 2, small hall

table flats:
(f_id, f_loc_id, f_b_id, f_name)
1, 1, 1, Flat A
2, 1, 1, Flat B
3, 1, 2, Best Flat
4, 2, 1, Apartment A
5, 2, 1, Apartment B
6, 2, 2, Apartment AA


record source for form is table 'flats'.
I display for example f_id=3, which is 'Best flat' situated at 5th ave (loc_id=1) in building 'small tower' (b_id=2). Second listbox (buildings) shows buidlings from 5th ave (small tower and big tower).

I change first listbox value; from '5th ave' to 'Broadway'. Page refreshes; choosen value is used in custom SQL (source of second listbox), so second listbox now shows 'big hall' and 'small hall'.

But first listbox still shows '5th ave'...

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.