Welcome Guest, Not a member yet? Register   Sign In
[solved] A shorter way to populate a Radio button
#2

[eluser]Lotus[/eluser]
Code:
$check_si1 = array(
    'name'        => 'regmotor',
    'id'          => 'regmotor',
    'value'       => 'TRUE'
);

$check_no1 = array(
    'name'        => 'regmotor',
    'id'          => 'regmotor',
    'value'       => 'FALSE'
);

if($this->form_data->regmotor):

    if($this->form_data->regmotor == 'true'):
        $check_si1['checked'] = TRUE;
    endif;  

    if($this->form_data->regmotor == 'false'):
        $check_no1['checked'] = TRUE;
    endif;
endif;

echo 'Si'.form_radio($check_si1).'  '.'No'.form_radio($check_no1);


Messages In This Thread
[solved] A shorter way to populate a Radio button - by El Forum - 10-23-2012, 08:53 AM
[solved] A shorter way to populate a Radio button - by El Forum - 10-23-2012, 09:05 AM
[solved] A shorter way to populate a Radio button - by El Forum - 10-23-2012, 09:11 AM
[solved] A shorter way to populate a Radio button - by El Forum - 10-23-2012, 10:10 AM



Theme © iAndrew 2016 - Forum software by © MyBB