I am trying to pre-select an option in a standard HTML select dropdown
using option.writeAttribute('selected', 'selected'). It worked in IE
and FF, but not in Safari. I had to change the code to
option.selected=true for all 3 browsers to work. I'd prefer to use the
writeAttribute wrapper instead of dealing with low level calls. That
was the whole point of switching to Prototype...
$$('#languageDropdown option').each(
function(option) {
console.info(languageId,
parseInt(option.readAttribute('value')));
if (parseInt(option.readAttribute('value')) === languageId) {
console.info('match');
// FAIL IN SAFARI
option.writeAttribute('selected', 'selected');
// SUCCESS IN SAFARI
option.selected=true;
} else {
option.writeAttribute('selected', null);
}
}
);
--
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en.