One valuelist depending on another valuelist's selection
Posted: Wed Jul 15, 2009 12:52 pm
Hello,
I have 3 tables, one for organisations, individuals and invoices and I would like to create a single table to make notes about the above as and when I need to.
The relevant tables are:
tbl_organisations
tbl_individual
tbl_invoice
the history table is called tbl_ history, the contents of which are:
I have a fifth table which lists the names of the tables:
The /tbl_history/valuelists.ini file contains the following:
The question is, when i create a new history record and I select the tbl_organisation, i would like this to then change the contents of the drop down below it to only show names of organisations, and if I select the invoices, it will ony show lists of invoices.
Sorry this is a bit of a long question, but I hope all the information is there for someone to assist.
Many thanks, Tom
I have 3 tables, one for organisations, individuals and invoices and I would like to create a single table to make notes about the above as and when I need to.
The relevant tables are:
tbl_organisations
tbl_individual
tbl_invoice
the history table is called tbl_ history, the contents of which are:
- Code: Select all
his_id INT(6) (NULL) NO PRI (NULL) AUTO_INCREMENT SELECT,INSERT,UPDATE
his_parentid INT(6) (NULL) NO MUL (NULL) SELECT,INSERT,UPDATE
his_parenttable INT(6) (NULL) NO (NULL) SELECT,INSERT,UPDATE
his_notes TEXT utf8_general_ci NO (NULL) SELECT,INSERT,UPDATE
his_enteredby INT(6) (NULL) NO (NULL) SELECT,INSERT,UPDATE
his_dateandtime DATETIME (NULL) NO (NULL) SELECT,INSERT,UPDATE
I have a fifth table which lists the names of the tables:
- Code: Select all
tbl_id INT(6) (NULL) NO PRI (NULL) AUTO_INCREMENT SELECT,INSERT,UPDATE
tbl_name CHAR(255) latin1_swedish_ci NO (NULL) SELECT,INSERT,UPDATE
tbl_description CHAR(255) latin1_swedish_ci NO (NULL) SELECT,INSERT,UPDATE
tbl_showinhistory BINARY(1) (NULL) NO (NULL) SELECT,INSERT,UPDATE
The /tbl_history/valuelists.ini file contains the following:
- Code: Select all
[his_parenttable]
__sql__ = "SELECT tbl_id, tbl_description FROM tbl_tables ORDER BY tbl_description"
The question is, when i create a new history record and I select the tbl_organisation, i would like this to then change the contents of the drop down below it to only show names of organisations, and if I select the invoices, it will ony show lists of invoices.
Sorry this is a bit of a long question, but I hope all the information is there for someone to assist.
Many thanks, Tom