Hi,
I am able to pull the data from DB and show as a drop down menu with column name "name" in chronoform. However I need to use a textbox to add "info" based on the selected drop down menu "name". But somehow my code doesn't work and just give me a blank white page if I add the hidden textbox. Here is my code:
Please advice.
I am able to pull the data from DB and show as a drop down menu with column name "name" in chronoform. However I need to use a textbox to add "info" based on the selected drop down menu "name". But somehow my code doesn't work and just give me a blank white page if I add the hidden textbox. Here is my code:
<select class="cf_inputbox" id="designation_list1" size="1" title="" name="designation_list1" style="width:500px;">
<option value="">Select agency</option>
<?php
$db =& JFactory::getDBO();
$query = "
SELECT num, name, impact
FROM #__agency ORDER BY name ASC ";
$db->setQuery($query);
$rows = $db->loadObjectList();
foreach ($rows as $row) {
echo "<option value='".$row->num."'>".$row->name."</option>";
}
?>
</select> //the above code works perfectly
//using the below code to show data based from selection above doesn't work
<?php
$db =& JFactory::getDBO();
$query = "
SELECT *
FROM #__agency WHERE name=1 AND impact=1";
$db->setQuery($query);
$options = $db->loadAssocList();
?><input type="text" name="des11" id="des11" value="<?php echo $options->impact; ?>" />
Please advice.