How to use validator |
[eluser]il_dandi[/eluser]
Hi!!! How Can I manage the validation… I would like apply CSS on the textbox and combobox border in my controller I've: Code: function add() in the view I have Code: <?php $v =& $this->validation ?> I would like to see the textbox with a red border...as I've seen in many examples (linkster...) how can I apply the CSS?? In HTML code of linkster example I’ve <label for=“title”>* Title: </label><input type=“text” name=“title” value=”” id=“title” class=“field_error” /></p> in my HTML code I’ve <td><input type=“text” value=”” name=“lastname” class=“” /></p> Thanks for help me!!!
[eluser]pistolPete[/eluser]
Use the new Form validation library. In your view: Code: <td align="right">cognome: </td><td><input name="lastname" type="text" id="lastname" size="30" maxlength="255" value="<?php echo set_value('lastname'); ?>" class="<?php echo ( form_error('lastname') == '') ? '': 'your_error_css_class' ;?>" ></td>
[eluser]il_dandi[/eluser]
thanks thanks thanks ... I've only to modify my view as you have written in your post?? nothing else?? all other my code is it OK? thanks
[eluser]pistolPete[/eluser]
No, if you want to use set_value() and form_error() you have to use the new Form validation library, as I wrote above. |
Welcome Guest, Not a member yet? Register Sign In |