Welcome Guest, Not a member yet? Register   Sign In
Checkbox ?
#1

[eluser]fuji2009[/eluser]
Hello guys, i don t understand how work checkbox i do it :

View :
Code:
<tr>
                <td>
                &lt;input type="checkbox" name="mycheck" value="&lt;?php echo set_value('mycheck');?&gt;" &gt;
                &lt;/td>
                </tr>
                <tr><td>&lt;?php echo form_error('mycheck','<div class="error">','</div>');?&gt;</td></tr>

and my controller :

Code:
$this->form_validation->set_rules('mycheck', 'Mycheck', 'required');

But the error work when i validate without check the box but when i check the box error again..


can you help me ? thanks you
#2

[eluser]RedIgniter[/eluser]
I don't believe you need to set a value for the checkbox through php, just have it some value like accept and check if $this->input->post('mycheck') == "accept"

let me know if it worked




Theme © iAndrew 2016 - Forum software by © MyBB