Try inserting it, then checking it after it's in the DOM. Also, try
setting input.checked = true rather than adding that as a part of the
initial new Element deal.
if ( i == 1 ) {
var input = new Element(
'input',{
'type': 'radio',
'value': i,
'name': 'test'
}
);
li.insert(input);
input.checked = true;
}else{
var input = new Element(
'input',{
'type': 'radio',
'value': i,
'name': 'test'
}
);
li.insert(input);
}
See if that helps.
Walter
On Mar 3, 2009, at 6:49 PM, jachin wrote:
> Does anyone know of a work around to this problem? A way to get a
> dynamically generated radio button selected?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---