hi there
I am trying to dynamically create some radio buttons, similar to the
example at the bottom. The code works as one would expect in every
browser I have tried except IE 7. (It adds 3 radio buttons"checking"
the middle one).
Does anyone know of a work around to this problem? A way to get a
dynamically generated radio button selected?
Thanks.
-jachin
-----------------------
<html>
<head>
<script src="prototype-1.6.0.3.js" type="text/javascript"
charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
document.observe("dom:loaded", function() {
var my_list = $('my_list')
for( i = 0; i < 3; i++ ) {
var li = new Element( 'li' );
if ( i == 1 ) {
var input = new Element(
'input',
{
'type': 'radio',
'value': i,
'name': 'test',
'checked': 'checked' }
);
}
else {
var input = new Element(
'input',
{
'type': 'radio',
'value': i,
'name': 'test' }
);
}
li.insert(input)
my_list.insert(li);
}
});
</script>
</head>
<body>
<form>
<ul id="my_list">
</ul>
</form>
</body>
</html>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---