I'm trying to use the AUI single select component in an edit view; I'd like to select a value in the list on page load but can't figure out how to make it happen the right way.
I've tried setting the 'value' property via javascript as described in the documentation, e.g.
// Nothing is set by the following. If I give the options a value and try to // set that, the same thing happens. document.getElementById('login').value = 'Dropbox'; // Results in undefined alert(document.getElementById('login').value);
It looks like I can set "selected='true'" on an option (not documented in the link above) which mostly works, but the associated image is not displayed in the selected value (see jsbin example.)
Is there some other way I should be going about this? Thanks.
Adding the "selected" attribute to one of the <aui-option> elements is the right way to do this. Looks like there's a bug with it not rendering the icon though. I've raised https://ecosystem.atlassian.net/browse/AUI-3557 to track this.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.