janick.eisert
Posts: 0
Joined: Tue Apr 24, 2012 1:32 pm

select menu: select option

I want to select an option of the select menu. I've tried

$(".selectMenu").val(2);

This should select the option with value 2, but it doesn't work.

In a normal HTML page, it works. How do I solve this problem?

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

select menu: select option

It should still work, make sure the selector is correct. Use Chrome tools (or Firebug) to see what's the actual id is.

You can also use Tiggr(id) function:
http://help.gotiggr.com/documentation...

janick.eisert
Posts: 0
Joined: Tue Apr 24, 2012 1:32 pm

select menu: select option

I've tried the Tiggr function, but it still doesn't work. The selector and the value is correct. Can you try if it works (in your application)?

Thanks for your help.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

select menu: select option

I think when you pass a value it sets the value, it doesn't get it: http://api.jquery.com/val/

janick.eisert
Posts: 0
Joined: Tue Apr 24, 2012 1:32 pm

select menu: select option

I want to set the value...

< select
< option value=" 1 "A < / option
< option value=" 2 "B < / option
< option value=" 3 "C < / option
< / select

When I have this select menu, A is selected (default). But I want that B is selected.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

select menu: select option

code
Tiggr('&#46;selectMenu')&#46;val(2);
Tiggr('&#46;selectMenu)&#46;selectmenu('refresh');
/code

http://jquerymobile.com/demos/1.1.0/d...

You can also use jQuery directly to select (without Tiggr(id) function).

Return to “Issues”