Hi, I'm trying to set up a textbox using chronoforms and have default values [vid] in it.
I'm getting the values [aid] from [admins] and [vid] from [vendor] and after that add them to the textbox as default values. I would like to have value later to be inputted into [product_id] of my database.
But, I just can't seem to get it worked out. The values doesn't show but the text box appears. The following is the code.
I'm not sure what has gone wrong. But have been trying for the whole day without much avail.
I'm getting the values [aid] from [admins] and [vid] from [vendor] and after that add them to the textbox as default values. I would like to have value later to be inputted into [product_id] of my database.
But, I just can't seem to get it worked out. The values doesn't show but the text box appears. The following is the code.
<?php
// Get user-information from Joomla
$user = &JFactory::getUser();
?>
<div class="form_item">
<div class="form_element cf_textbox">
<?php
if (!$mainframe->isSite() ) {return;}
$db =& JFactory::getDBO();
$query = "
SELECT aid, vid
FROM admins, vendor
WHERE user_id = $user->id
AND vid = aid;
";
$db->setQuery($query);
$vendorID = $db->loadAssocList();
?>
<input type="text" class="cf_inputbox required" name="product_id" id="" value="<?php echo $vendorID->vid; ?>"; />
</div>
<div class="cfclear"> </div>
</div>
I'm not sure what has gone wrong. But have been trying for the whole day without much avail.