0

Hello,
I am learning codeigniter
So I have 3 radio button. My code as under

View Page

<li id="AgencyType" style="z-index: 93;">
        <label class="mandatory" for="ExternalAgency">Are you an employment agency?</label>

        <ul>
            <li style="z-index: 92;">
                <?php 
                    $data = array(
                            'id'=>'ExternalAgency',
                            'name'=>'ExternalAgency',
                    );
                    echo form_radio($data);?>

                <label for="ExternalAgency">No, we recruit directly.</label>
            </li>

            <li style="z-index: 91;">
                <?php 
                    $data = array('id'=>'HeadhuntingAgency',
                                'name'=>'ExternalAgency');
                    echo form_radio($data); ?>

                <label for="HeadhuntingAgency">Yes, we are a headhunting/recruitment agency.</label>
            </li>

            <li style="z-index: 90;">

                <?php $data = array('id'=>'TemporaryAgency',
                            'name'=>'ExternalAgency'); 
                echo form_radio($data); ?>

                <label for="TemporaryAgency">Yes, we are a temporary staffing agency.</label>
            </li>

            <?php echo form_error('ExternalAgency','<span style="color:red;float:none;">','</span>'); ?>

    </ul>

Visula Output

27483aa56dc4de9c558b08cc6a2d978e

Problem:
If No One can selected then given me Error message.

Given me suggestion

Thank you

Edited by ravi142: more description added

2
Contributors
3
Replies
20
Views
3 Years
Discussion Span
Last Post by iamthwee
0

i have used form validation in my controller

$this->form_validation->set_rules('ExternalAgency','Select one','required');

Edited by ravi142

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.