RE: [Phplib-users] oohforms select validation
Brought to you by:
nhruby,
richardarcher
From: Matt W. <ma...@ye...> - 2002-02-13 13:25:24
|
> > Now I find myself at a loss about select box validation. > > I am not sure I get you - you just need that the user *must* select a > value right? > > OR am I missing something? I managed to sort it out. The manual says that the first option will not be accepted by the validator. But if the value of the first item is an integer and the values for the other select items are strings, the validation will always fail. Setting it to a string or leaving out the value attribute, will make the validation behave as expected. So if I have "options"=>array(array("label"=>"Please Select","value"=>1), array("label"=>"Apple","value"=>"apple")), "size"=>1, "valid_e"=>"Please Select", etc... The validation will always fail. But if I change the first option to array("label"=>"Please Select") The select box will validate as expected m: |