Dan Sweeney
Posts: 0
Joined: Thu Feb 21, 2013 9:49 am

Set Select control default value dynamically

I'm trying to set the value of a select list control dynamically on the page load event based on the value from a local variable.

I've tried a few things including:
Tiggzi('mSelectBrakes').val('Sat');
and
Tiggzi('mSelectBrakes').val('Sat').selectmenu().refresh();

Thanks in advance

Oleg Danchenkov
Posts: 0
Joined: Tue Apr 30, 2013 5:51 pm

Set Select control default value dynamically

Hi Dan.
Try this
codeAppery('mSelectBrakes').val('Sat').selectmenu('refresh'); /code

Dan Sweeney
Posts: 0
Joined: Thu Feb 21, 2013 9:49 am

Set Select control default value dynamically

Hi Oleg

No, that doesn't work.

Any other ideas? (ps fyi Sat is an available item in the list)

Thanks

Oleg Danchenkov
Posts: 0
Joined: Tue Apr 30, 2013 5:51 pm

Set Select control default value dynamically

Try this code on Page show event. And check the value 'Sat' (in select must be item with value='Sat'. It's case sensitive)

Dan Sweeney
Posts: 0
Joined: Thu Feb 21, 2013 9:49 am

Set Select control default value dynamically

I figured it out, I was trying to set the value to the label property of the select option instead of the value property. I've set these both the same now to avoid this problem.

Thanks

Return to “Issues”