form validation on dropdown |
[eluser]JanDoToDo[/eluser]
hey guys. I have a dropdown menu with form validation set on it to "required". Howeverwhen the form loads i want the first item select to be "please select..." but when the form gets submitted, obviously a value is sent and so it thinks the required validation has been met but its still on its default so how can i change this?? Ideas? Thanks
[eluser]Krzemo[/eluser]
What values you have for options? Numbers? Text? If numbers use i.e. value="0" for "please select..." option and in rules put 'required|is_natural_no_zero'. If texts make "please select..." value="" and rule 'required' should work. If none of those two apply - write your own callback (http://ellislab.com/codeigniter/user-gui...#callbacks) Regs K
[eluser]JanDoToDo[/eluser]
Cheers for that! I thought I had tried putting it as "" but obviously I hadn't! thankyou |
Welcome Guest, Not a member yet? Register Sign In |