I'm having trouble setting an option in a multiselect field to be the
default selected option.

The HTML looks something like this:
<select multiple="multiple">
<option value="Any" selected>Any</option>
<option value="Python">Python</option>
</select>

The 'value' attributes I think are optional (or I'm not sure what they
do as far as posting the form is concerned), but FormKit puts them
there.
The MultiSelectField has a method addChoice(value, label) where label is
what appears between the opening and closing option tags, but it doesn't
take an attributes dict argument. I've tried using addAttributes and
setDefault on the field, but I think it is being reset somewhere in
_setAttributes method of some base class. Anyway, I can't get it to
work.

Anyone know the best way to set an option to be selected?

Also, a MultiSelectField has a list value if more than one option is
selected, and a string otherwise. Do you think it would be better if it
always returned a list?

Thanks,
Steve


-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to