Mookie
Posts: 30
|
| Posted: 08/03/2005, 3:45 AM |
|
Hello All and thanks
I am trying to have two dependent drop lists that will display data from the same table. The second drop list will display only the fields from the database where the first drop is selected.
I know I could do this easier with two related tables such as the country-state, but I am wondering if this can be achieved before I change the database configurations.
Thanks all
_________________
Thank you! |
 |
 |
Walter Kempees
|
| Posted: 08/03/2005, 5:48 AM |
|
Yes, this can be done.
Table design is yours, rest could follow the dependent listbox examples
all-over this forum, but best viewed in the 'tips and solution'
Walter
"Mookie" <Mookie@forum.codecharge> schreef in bericht
news:542f0a0614524e@news.codecharge.com...
> Hello All and thanks
>
> I am trying to have two dependent drop lists that will display data from
> the
> same table. The second drop list will display only the fields from the
> database
> where the first drop is selected.
>
> I know I could do this easier with two related tables such as the
> country-state, but I am wondering if this can be achieved before I change
> the
> database configurations.
>
> Thanks all
> _________________
> Thanks
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
Mookie
Posts: 30
|
| Posted: 08/03/2005, 9:40 AM |
|
Thanks Walter.
I've searched and read all drop down list examples, but they all refering to two related tables where one table lists one field, and the other lists their crosponding values on the other table.
Mine is different that I am using one single table. One field of the table is state and another field is city. The first field is displaying all the states, but I want the second field to only display cities that match with currenly selected state.
Thanks
_________________
Thank you! |
 |
 |
peterr
Posts: 5971
|
| Posted: 08/03/2005, 11:40 AM |
|
I think that this should work with one table without problems.
In addition to forums, CCS Example Pack 2 includes such example: http://examples.codecharge.com/CCSExamplePack2/Dependen...dentListBox.php (again with two tables, but it should be no different with one)
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
Walter Kempees
|
| Posted: 08/03/2005, 4:19 PM |
|
Mookie:
You read them all? Did you find mine ?
I know what I wrote earlier, (can be done no problem) but:
a/ this way of table definition was used in the period when file systems had
limitations (number of concurrent open files).
b/ Normalization theory doesnot encourage this design.
c/ with all due respect: if creating this lookup from the examples already
imposes a barrier how are you going to build the grid and record form?
Mayby it is better to split the table in to two, and buikd it the 'standard'
way.
At least it will save you a lot of time.
If you still want to go your route do the given examples, there really is no
trick just substitute the tables for your one table.
We used to do this in a three level way in which a table would contain the
'name of lookup table', the 'values for each table' and an 'owner_id'
indicating '0000' for system-wide values, 'nnnn'for values added by a
specific customer.
Maintenance, backup/restore were not fun to do/build, only real advantage is
a user is presented with values from a lookup in the '0000'+ 'nnnn' range
and of course it was Clarion for DOS, running on DOS system with files=99
and buffer=............... should I say more.
greetz
Walter
"peterr" <peterr@forum.codecharge> schreef in bericht
news:542f10f9d8e0fb@news.codecharge.com...
>I think that this should work with one table without problems.
> In addition to forums, CCS Example Pack 2 includes such example:
> http://examples.codecharge.com/CCSExamplePack2/Dependen...dentListBox.php
> (again with two tables, but it should be no different with one)
> _________________
> Peter R.
> YesSoftware Forums Moderator
> For product support please visit http://support.yessoftware.com
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
|