Welcome Guest, Not a member yet? Register   Sign In
form validation on dropdown
#1

[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 Smile
#2

[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
#3

[eluser]JanDoToDo[/eluser]
Cheers for that!

I thought I had tried putting it as "" but obviously I hadn't! thankyou Smile




Theme © iAndrew 2016 - Forum software by © MyBB