hi
can i pull records from multiple fields and use them on my form controls? i have used the code to retrieve data on a combo box using:
<option value="">Select Product From List</option>
<?php
$database =& JFactory::getDBO();
$database->setQuery("SELECT * FROM mmgqz_chronoforms_data_Products WHERE discontinue='NO' ORDER BY name");
$name = $database->loadObjectList();
foreach($name as $name):
?>
<option value="<?php echo $name->name; ?>"><?php echo $name->name; ?></option>
<?php endforeach; ?>
i wanted data associated to the selected record to be displayed in my fields on a different form but be updated in their respective tables when the record is saved. thank you.
can i pull records from multiple fields and use them on my form controls? i have used the code to retrieve data on a combo box using:
<option value="">Select Product From List</option>
<?php
$database =& JFactory::getDBO();
$database->setQuery("SELECT * FROM mmgqz_chronoforms_data_Products WHERE discontinue='NO' ORDER BY name");
$name = $database->loadObjectList();
foreach($name as $name):
?>
<option value="<?php echo $name->name; ?>"><?php echo $name->name; ?></option>
<?php endforeach; ?>
i wanted data associated to the selected record to be displayed in my fields on a different form but be updated in their respective tables when the record is saved. thank you.
Hi ahmedeen76,
I'm sorry I don't understand your question :-(
Please see this FAQ for some ways to link data from a table to form inputs - but this does more or less the same as the code you posted.
Bob
I'm sorry I don't understand your question :-(
Please see this FAQ for some ways to link data from a table to form inputs - but this does more or less the same as the code you posted.
Bob
hi greyhead
i am including screen shots of the form view and design view so that you can get the picture of my troubles. if you look at the form in the front view i have a drop down control for products that is linked to the products table. I need that when the user selects a product from the product drop down control the stock balance textfield displays the balance of the selected product in the products table.
lastly when the user clicks on save button i need two tables in the inventory database be updated accordingly i.e. the dispatch table should add a new dispatch record and the products table should update the stock balance field of the selected product (i.e. which is a difference of stock balance and the value entered in the units dispatched textfield). Thank you sir.
i am including screen shots of the form view and design view so that you can get the picture of my troubles. if you look at the form in the front view i have a drop down control for products that is linked to the products table. I need that when the user selects a product from the product drop down control the stock balance textfield displays the balance of the selected product in the products table.
lastly when the user clicks on save button i need two tables in the inventory database be updated accordingly i.e. the dispatch table should add a new dispatch record and the products table should update the stock balance field of the selected product (i.e. which is a difference of stock balance and the value entered in the units dispatched textfield). Thank you sir.
Hi ahmedeen76 ,
Thank you, I think I understand now.
The Ajax enabled dropdown [P] action will let you populate a test input (or a span) in the form using Ajax linked to a drop down selection.
You can use several DB Save actions in your form, just make sure that the input names and column names match up exactly to get the correct data saved. You can also use hand-coded database queries if necessary.
Bob
Thank you, I think I understand now.
The Ajax enabled dropdown [P] action will let you populate a test input (or a span) in the form using Ajax linked to a drop down selection.
You can use several DB Save actions in your form, just make sure that the input names and column names match up exactly to get the correct data saved. You can also use hand-coded database queries if necessary.
Bob
This topic is locked and no more replies can be posted.