I have a dropdown box populated through a db query. I want the selection from this dropdown to populate a form based on a db read. Reading through the forums, etc. it seems like this solution is evident to almost everyone except myself.
I have been through the forums, tutorials etc and still don't quite understand how to do this and need to get the project off my desk . I can easily post webpages up and provide access.
Any help out here?
You want 1 dropdown to populate multiple fields from the database, correct ?
If your main question got answered then please mark the answer using the button!
Yep. The dropdown lists the names of the forms submitters. I want to create the for a reviewer to select the name, have to form populate and allow a review of the entire form.
I have the dropdown working, it's just getting the down select to populate the form fields.
I would do this with a two page form - have the drop-down on the first page with a Next button, then have the main form on the second page and use a DB Read action together with the name from the first page to load the selected record.
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
I know this is extremely simple, but formulating the DB Read action is where I get hung up.
On page 1 the dropdown (dropdown2) contains the value of ecname field.
I am assuming that I need to get the selected value of (dropdown2) and input it into the condition statement of DB Read:
<?php return array('ecname' => '[dropdown2]'); ?> .
I can't find how to specifiy the selected dropdown value in the conditions statement.
return array( 'ecname' => $form->data['dropdown2'] ) ;
So when I go to the second page, the debugger shows the proper data array. The debugger shows the correct data for the query and the field ecname in debugger array is correct.
However, the text box on that page with field id and field name set to ecname does not populate.
Perhaps the setup sequence for page 2 is incorrect/incomplete ?
(after on submit)
On Page 2
HTML Render Form
Just bought you a cuppa. Hope that helps a bit.
Just found the problem. All is good. The DB Read was set Yes to Model ID. When set to No the form populates correctly.
Thanks for your help.
2CheckOut.com Inc. (Ohio, USA) is an authorized retailer for goods and services provided by ChronoEngine.com