On Tue, 14 Oct 2003, Gisle Aas wrote: > John J Lee <[EMAIL PROTECTED]> writes: [...] > Yes. If a form contains: > > <select name=sex> > <option value=F> Female > <option value=M> Male > <option value=?> Unknown > </select> > > Then the values that this field might take becomes "F", "M" and "?", > while the value names are "Female", "Male" and "Unknown". With newer > version of HTML::Form you can use both to modify the values. The > statement [...]
OK. Did you notice that both the value and the label of OPTION default to the contents (eg. Female here), according to the HTML 4 spec? In my Python module, I decided to allow people to set options 'by label'. I guess your scheme doesn't let you use the label (foo) here: <option value=f label=foo>bar</option> while my scheme doesn't let you use the element contents (bar) in that same case. Hm... [...] > No. It's the same concept as for the select/option shown above. If > you have a form containing: > > <input name=sex type=radio value=F> Female > <input name=sex type=radio value=M> Male > <input name=sex type=radio value=? checked> Unknown > > then the values and value names for the sex field will be the same as > in the previous example and: > > $form->param(sex => "male") > > will just work. That is if you are not surprised by $form->("sex") > returning "M" even if you just set it to "male". I see. That's not a part of the HTML spec IIRC (unlike the case of OPTION), but I guess it could be useful. Of course, there can also be explicit LABEL elements, but I suspect people rarely use them, so probably not very useful. John