Eifion wrote:
> I was using $F today to read the value of a SELECT element and found
> that if the value of one of the options is an empty string, the option's
> text is returned instead. For example in the code below, if One, Two
> Three or Four was the selected option then I'd get 1,2,3 or 4 from $F,
> but if the first option's selected then I get "--SELECT--" back.
> 
> Is this how $F is supposed to work?
> 
> Eifion
> 
> <select name="mr_select" id="mr_select">
> <option value="">--SELECT--</option>
> <option value="1">One</option>
> <option value="2">Two</option>
> <option value="3">Three</option>
> <option value="4">Four</option>
> </select>

I complained about this a few days ago. That's just how it works and it's a bug
IMHO. The only way I know how to deal with it is to use a "0" instead of "" and
then change the server side code to deal with that.

-- 
Michael Peters
Developer
Plus Three, LP

_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to