You code needs to be submited to controller if you want to use validation.
class Form extends Controller {
function index()
{
$this->load->helper(array('form', 'url'));
$this->load->library('form_validation');
$this->form_validation->set_rules('radio', 'Product', 'required');
if ($this->form_validation->run() == FALSE)
{
$this->load->view('myform');
}
else
{
$this->load->view('formsuccess');
}
}
}
By you dont really need validation for RADIO. When you generate the radio button, make one selected and it will always have value.
Try it like this, this should work better. It will generate the radio boxes with 1st one checked by default if value for radios is not set:
echo form_radio('radio','earing', set_radio('radio', 'earing', TRUE))."earings";
echo form_radio('radio','bag', set_radio('radio', 'bag'))."bag";
echo form_radio('radio','bracelet', set_radio('radio', 'bracelet'))."bracelet";
echo form_close();