Forums

Pre fill checkbox input

2caffe 16 Feb, 2012
Hi all,
I built a form in order to edit a record loaded from DB, so I have to pre fill the fields in the form with saved data.
I don't use the standard element "DB Record Loader", since I have to do some operations with those data. I have no problems with textfield, in fact in a "Custom code" element I use:

$db =& JFactory::getDBO();
$query = "...";
$db->setQuery($query);
$row = $db->loadAssoc();
$form->data['at_dataint'] = $row['at_dataint'];

the problem is that I can't set a checkbox checked.
The field in DB table has 'Y'/'N' values.

Is there a way to do this?
Thank you in advance.
2caffe
2caffe 16 Feb, 2012
I think I posted my question in the wrong place... could you please move it in the right place?
Thanks.
Max_admin 16 Feb, 2012
Hi 2caffe,

Does your checkbox have 2 or more options and at least 2 of them has the values "Y" and "N" case sensitive ?

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.