menuitem[type].formwidget

For some menu's that contain mixed types of menuitems, or that contain submenuus, it is hard to interpret a desired value of the containing widget (the menu). In these cases, you can use the <menuitem class="formwidget" so each menuitem is itself a formwidget. The only menuitems that are usefull as data container are menuitems that can be checked, radio's and checkbuttons. The menuitem will return it's name/value/label only when checked.

The containing widget (menulist,button,menu) should be a normal XUL element, not a formwidget.

Note: what goes into menulike things can be very diverse. Even XUL itself yields confusing results, as the testsuite demonstrates.

Note 2: menuitem[type=radio] already has a name attribute in xul. The idea is that menuitems of type radio with the same name belong to the same group, and only one such menuitem can be checked in a group at the same time. Unfortunately, some Mozillas seem to ignore that idea when checking menuitems with javascript. That's a bug.

Note3: when seeding, checkbox menuitems are never unchecked. Such is the nature of a checkbox: if it is not checked, it doesn't mean it should be unchecked; it means nothing. If you need a switch, use radiobuttons.

Note4: For some Mozillas, it appears the binding for a menuitem is not made until the item has been 'used' in some. For example, if the item is hidden inside a submenu, it isn't a formwidget until you look at it :) . That's another bug.

Example:

<menuitem name="mitem" value="yes" label="check2" class="formwidget" /> result:
seed:mitem/yes/check2 cgi:mitem=yes

Additional Attributes:


Additional Methods: