Welcome Guest, Not a member yet? Register   Sign In
Cannot get form validation > set_radio to work
#3

[eluser]cideveloper[/eluser]
One thing you need to make sure you do is validate the radio field in the controller. This is part of the design of codeigniter. Even if you just use trim in the set_rules for the specific field. If you post the specific sections of your views and controller more help can be given.

View

Code:
<p>
<label for="like_site">Do you like this site?</label><br />
&lt;input type="radio" name="like_site" value="yes" &lt;?php echo set_radio('like_site', 'yes', TRUE); ?&gt; /&gt;
&lt;input type="radio" name="like_site" value="no" &lt;?php echo set_radio('like_site', 'no'); ?&gt; /&gt;
<span id="like_site_error">&lt;?php echo form_error('like_site'); ?&gt;</span>
</p>

Controller

Code:
$this->form_validation->set_rules('like_site', 'Like/Dislike', 'trim');


Messages In This Thread
Cannot get form validation > set_radio to work - by El Forum - 08-20-2010, 04:39 PM
Cannot get form validation > set_radio to work - by El Forum - 08-23-2010, 06:01 PM
Cannot get form validation > set_radio to work - by El Forum - 08-23-2010, 06:51 PM



Theme © iAndrew 2016 - Forum software by © MyBB