Hello! I have read the how to "https://www.chronoengine.com/faqs/70-cfv5/5219-how-to-load-record-data-from-a-database-table-into-your-form.html" but I have some problem yet.
So, I have in a database two table that we can call table1 and table 2.
In table1 there is filed1 and in table2 there is filed2.
When I enter data in table2, I want to fill field2 with the data that I have in table1[field1], with a dropdown that show me all the record of table1 so that I can select the data I want.
I have done a form and "ON LOAD" event above html rendering I have selected the "table name", have done "yes" on multi read, etc etc .. but I think there is a problem on the code I have enter in "conditions"..
Can I have some help??
Thank You !!
So, I have in a database two table that we can call table1 and table 2.
In table1 there is filed1 and in table2 there is filed2.
When I enter data in table2, I want to fill field2 with the data that I have in table1[field1], with a dropdown that show me all the record of table1 so that I can select the data I want.
I have done a form and "ON LOAD" event above html rendering I have selected the "table name", have done "yes" on multi read, etc etc .. but I think there is a problem on the code I have enter in "conditions"..
Can I have some help??
Thank You !!
Hi cyber81,
I find your question difficult to understand. Can you please give more of an example.
What code do you have in the Conditions box now?
If you add a Debugger action to the On Load event of your form what do you see being loaded?
Bob
I find your question difficult to understand. Can you please give more of an example.
What code do you have in the Conditions box now?
If you add a Debugger action to the On Load event of your form what do you see being loaded?
Bob
Hello! I want to load a data of field.tableX of form X and record it in field.tableY of Form Y.
from what I understand I can use DBREAD function on load above html render. If I edit DBREAD there is a filed called "conditions" in wihch i must insert the code as the example.. I don't understand which code?
from what I understand I can use DBREAD function on load above html render. If I edit DBREAD there is a filed called "conditions" in wihch i must insert the code as the example.. I don't understand which code?
Hi cyber81,
The Conditions box creates a WHERE clause to select records from the table. Please see this FAQ for the way to write conditions.
I'm afraid that I can't work out what condition you need from the information you have posted :-(
Bob
The Conditions box creates a WHERE clause to select records from the table. Please see this FAQ for the way to write conditions.
I'm afraid that I can't work out what condition you need from the information you have posted :-(
Bob
Sorry for the new reply, but if I don't want use conditions I can leave blank the filed ?
I have found this FAQ to resolve my problem:
Dynamic Data from a database table
You can use the ChronoForms DB Multi Record Loader action (or the DB Read action in CFv5) to create a data-set to use as your option list. You need to drag a copy of the action into the On Load event of your form and move it up before the Show HTML action. On the action General Tab you need to set at least the Table and Fields boxes (you may well need to complete others to select the records that you want to use).
For example, we might select the jos_content table and then add id,title in the Fields box. Note that the Model ID will default to josContent unless you set another value.
Save the action and go back on the Dynamic Data tab on the element. Enable the Dynamic Data; enter the Model ID josContent in the 'Model ID' box, then id in the 'value' box and title in the 'text' box.
Save the element and test the form, you should see a list of options that display the article titles as labels and return the matching article id when the form is submitted.
If you want to create a simple list where the value and label are the same you can just put title in both of the 'value' and 'text' boxes.
I try, but not work..
I have found this FAQ to resolve my problem:
Dynamic Data from a database table
You can use the ChronoForms DB Multi Record Loader action (or the DB Read action in CFv5) to create a data-set to use as your option list. You need to drag a copy of the action into the On Load event of your form and move it up before the Show HTML action. On the action General Tab you need to set at least the Table and Fields boxes (you may well need to complete others to select the records that you want to use).
For example, we might select the jos_content table and then add id,title in the Fields box. Note that the Model ID will default to josContent unless you set another value.
Save the action and go back on the Dynamic Data tab on the element. Enable the Dynamic Data; enter the Model ID josContent in the 'Model ID' box, then id in the 'value' box and title in the 'text' box.
Save the element and test the form, you should see a list of options that display the article titles as labels and return the matching article id when the form is submitted.
If you want to create a simple list where the value and label are the same you can just put title in both of the 'value' and 'text' boxes.
I try, but not work..
Hi cyber81,
Yes you can leave the Conditions box empty - then you will get all the records in the table.
The FAQ does work, it may not be working for you but it's impossible to help without more specific information.
Bob
Yes you can leave the Conditions box empty - then you will get all the records in the table.
The FAQ does work, it may not be working for you but it's impossible to help without more specific information.
Bob
Hello bob!
I want run a dropdown with dynamic data.. the dropdown must read the data from a tableX and store them in tableY of the dropdown form...
I want run a dropdown with dynamic data.. the dropdown must read the data from a tableX and store them in tableY of the dropdown form...
This topic is locked and no more replies can be posted.