cosmic_bird — 2011-04-14T13:04:45-04:00 — #1
Hi when I echo a radio button to the client page from the server, the radio button isn't 'selectable'.
echo "<div class='container'><input type='checkbox' id='pr2' value='" .$one . "' />" . $one . "</div>";
Any idea why?
starlion — 2011-04-14T13:14:38-04:00 — #2
Well first of all, you're not echoing a radio button, you're echoing a checkbox.
cosmic_bird — 2011-04-14T13:19:52-04:00 — #3
Sorry I meant to change that to radio button.
I was testing it with checkbox and it worked. But for some reason radio buttons don't work
starlion — 2011-04-14T13:28:03-04:00 — #4
So by 'isnt selectable' you mean it's Disabled? (Greyed out) Or... you're trying to programmatically select it and cant?
cosmic_bird — 2011-04-14T13:42:14-04:00 — #5
No it's not greyed out. When I try and select it manually, it just doesn't fill with the black dot.
I wonder if it's to do with me sending a html element to the client from the server.
starlion — 2011-04-14T13:43:28-04:00 — #6
Let me guess. You're using IE.
Try giving the radio button a NAME attribute.
cosmic_bird — 2011-04-14T14:39:09-04:00 — #7
Yep, using IE
Could you give an exmple of a NAME attribute please.
cosmic_bird — 2011-04-14T14:43:51-04:00 — #8
You're right. I tried it in Firefox and it works fine
starlion — 2011-04-14T14:45:15-04:00 — #9
<input type='checkbox' id='pr2' name='pr2' value='" .$one . "' />"
It's a known bug in IE that radio buttons without a name attribute cease to function. It's slated for fixing in IE9.
cosmic_bird — 2011-04-14T14:55:05-04:00 — #10
Great, thanks for your help