Validation Class --> error message |
[eluser]Rey Philip Regis[/eluser]
Why do it manually? There are javascript libraries that can do the work for you like dojo. I know they have the feature you need. http://dojotoolkit.org Good day..
[eluser]majidmx[/eluser]
Hey, As Rey mentioned it's better to do it by Javascript. But if you want to have both working exactly the same you can something like this : Code: <input type='text' value='<?PHP echo set_value('username'); ?>' class='<?PHP echo (isset(form_error('username') && form_error('username') != '')?'normal_css_class_name':'red_css_class_name' ) ?>' /> I have not tried it yet, but it gives you the idea. Take care, MajiD Fatemian
[eluser]hsl[/eluser]
Thx! The javascript suggestion was one I didn't think of. I'm implementing jquery right now. but i'm only going to use it for checking.
[eluser]majidmx[/eluser]
Yeah, it's good to have Javascript validation all the time. But always have the server-side equivalent too, just in case. Passing the javascript validation is not that much hard Take care, MajiD Fatemian |
Welcome Guest, Not a member yet? Register Sign In |