Welcome Guest, Not a member yet? Register   Sign In
select validation
#11

[eluser]runrun[/eluser]
opp! double post.
#12

[eluser]drewbee[/eluser]
From what I can tell, your default values on each of the drop downs are 0 (the key of date/month/year). 0 is still a valid value. Set your inital array to array('' => 'date') array('' => 'month') array('' => 'year') and CI should catch it as a blank value.
#13

[eluser]runrun[/eluser]
Leaving the initial value will work, I tried that. I just couldn't explain why CI validation takes the unselected as selected. And I hate to manipulate the data +1 or -1 later on, that doesn't look good to me.

Anyway, thank you very much Drew.
#14

[eluser]jacobc[/eluser]
Drew is correct... Just because "Date" isn't going to pass the required validation thing...

If a field is required, then the validation library checks if it is set or is ''.


Why do you need to use the keys? Why not set the value to the same as choice...

So the outputting html will be

<option value="1">1</option>

as opposed to using the keys...




Theme © iAndrew 2016 - Forum software by © MyBB