Echo a radio button, no functionality

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?

Well first of all, you’re not echoing a radio button, you’re echoing a checkbox.

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

So by ‘isnt selectable’ you mean it’s Disabled? (Greyed out) Or… you’re trying to programmatically select it and cant?

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.

Let me guess. You’re using IE.
Try giving the radio button a NAME attribute.

Yep, using IE

Could you give an exmple of a NAME attribute please.

You’re right. I tried it in Firefox and it works fine

<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.

Great, thanks for your help