Skip to content

No value returned as default ? #170

@badulesia

Description

@badulesia

Hi.
I post a form containing a selectboxitmenu. I don't click on the selectmenu, expecting it to return the first line as selected one. Nothing is send. I must click, open, select a line in order to have a value returned.

I click on a button to execute this as debug code
form = document.forms['someform']; idx = form.selectmenu.value; alert(idx);
nothing is returned as default. If the selectmenu is opened and clicked a value is returned as expected.

To bypass this, I use :
form = document.forms['someform']; idx = form.selectmenu.value; if (!idx) idx = form.selectmenu.options[0].value; alert(idx);

Notice that the selectedIndex attribute also returns nothing.

The first line of the menu seems not to be returned as default one if the menu is not clicked. Can you check this please ?

PS : the selectmenu has no option set. I add it a class ".boxit" and then simply
$(".boxit").selectBoxIt();'

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions