Jump to content

radio button "checked" does not work in Firefox


phppaper

Recommended Posts

Hello,

 

I am trying to do some coding here but found out that radio button of html form "checked" does not work in Firefox , the button remains uncheck, but it works fine in IE, anyone has the problem before and have the solution to share??

 

Or any other way to write "checked" for radio button which works in Fire fox??

 

I am using firefox 3.6

 

Thanks!

 

Example:

<input type="radio" name="number" value="1" checked="checked"> 1        <--- does not work in firefox (no check)

 

<input type="radio" name="number" value="1" checked> 1        <--- does not work in firefox (no check)

Link to post
Share on other sites
  • 2 months later...
  • 11 months later...

I just encountered this problem also, but found a cause and solution.

 

I was using radio buttons and other input elements on a page where the data was being posted via Ajax, and I did not need a form. However, the lack of a form tag caused this Firefox (4) problem i.e. checked='checked' was ignored on radio button inputs. Chrome was OK. I didn't check other browsers.

 

Adding a form tag to the page fixed the issue with Firefox. As inputs are supposed to be form elements, the behaviour is understandable.

 

Perhaps this was also the cause of the original poster's problem.

 

Link to post
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.