Page 1 of 1
Set Select control default value dynamically
Posted: Tue May 14, 2013 3:35 pm
by Dan Sweeney
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
Set Select control default value dynamically
Posted: Tue May 14, 2013 3:45 pm
by Oleg Danchenkov
Hi Dan.
Try this
codeAppery('mSelectBrakes').val('Sat').selectmenu('refresh'); /code
Set Select control default value dynamically
Posted: Tue May 14, 2013 4:05 pm
by Dan Sweeney
Hi Oleg
No, that doesn't work.
Any other ideas? (ps fyi Sat is an available item in the list)
Thanks
Set Select control default value dynamically
Posted: Tue May 14, 2013 4:21 pm
by Oleg Danchenkov
Try this code on Page show event. And check the value 'Sat' (in select must be item with value='Sat'. It's case sensitive)
Set Select control default value dynamically
Posted: Wed May 15, 2013 10:04 am
by Dan Sweeney
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