Forums / Cotonti / Extensions / Support / cot_extrafield_add radio

Twiebie
#36632 2012-12-27 19:30

I'm trying to add an extrafield for a radio button with option 0 and 1. However I want the options named No, Yes, but 0,1 in the DB respectively.

I gave it a go with the following code, but I think I've missed something:

if ($db->query("SHOW COLUMNS FROM `$db_users` WHERE `Field` = 'user_subs'")->rowCount() == 0)
{
    cot_extrafield_add($db_users, 'subs', 'radio', '<label><input type="radio" name="{$name}" value="{$value}"{$checked} /> {$title}</label>', '0,1', '0',
        false, '', 'Subscribe', 'No,Yes');
}

It adds the extrafield without problems, but the values are not correct.

This post was edited by Twiebie (2012-12-27 19:50, 12 years ago)