Hi,
I would like to know how to pull data into a form text box. I have tried using profile plugin, but it is not working. I have a new form, and I need to display information coming from another table. I've tried using the code below, but I don't think i have the format is correct. Thanks for helping
I would like to know how to pull data into a form text box. I have tried using profile plugin, but it is not working. I have a new form, and I need to display information coming from another table. I've tried using the code below, but I don't think i have the format is correct. Thanks for helping
<div class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label" style="width: 150px;">Driving License State*</label>
<input class="cf_inputbox required" maxlength="150" size="30" title="drivers state" id="text_11" name="state" type="text" />
<?php
if ( !$mainframe->isSite() ) { return; }
$db =& JFactory::getDBO();
$user = JFactory::getUser('id');
$query = "
SELECT state
FROM `#__chronoforms_registration`
WHERE `cf_user_id` = ".$user->id.";
";
$db->setQuery($query);
$d = $db->loadObject();
if ( count($d) ) {
echo "<input type='hidden' name='cf_id' id='cf_id' value='".$d->cf_id."'/>";
}
?>
</div>
<div class="cfclear"> </div>
</div>