phppaper Posted February 14, 2010 Share Posted February 14, 2010 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) Quote Link to comment https://forums.phpfreaks.com/topic/192033-radio-button-checked-does-not-work-in-firefox/ Share on other sites More sharing options...
PFMaBiSmAd Posted February 14, 2010 Share Posted February 14, 2010 There is nothing wrong with the first example. It works in FF. If it is not working for you, best guess is you have another radio button with that same name and value somewhere else in your form. Quote Link to comment https://forums.phpfreaks.com/topic/192033-radio-button-checked-does-not-work-in-firefox/#findComment-1012147 Share on other sites More sharing options...
Axeia Posted February 15, 2010 Share Posted February 15, 2010 What the above post says, the error is elsewhere, try validating the document with the w3c validator. (if you're using an XHTML doctype those inputs will need to be made self closing, e.g. end on /> instead of >) Quote Link to comment https://forums.phpfreaks.com/topic/192033-radio-button-checked-does-not-work-in-firefox/#findComment-1012743 Share on other sites More sharing options...
patriklko Posted April 17, 2010 Share Posted April 17, 2010 observe the code of the webpage must be the name is clashing with some other control as the coding is fine and should give positive results.... Quote Link to comment https://forums.phpfreaks.com/topic/192033-radio-button-checked-does-not-work-in-firefox/#findComment-1043680 Share on other sites More sharing options...
TeddyKiller Posted April 17, 2010 Share Posted April 17, 2010 Simple way to find out, is change the name of the checkbox. If all works then.. then find out where the other field is clashing with it EDIT: Uh oh, old thread. Quote Link to comment https://forums.phpfreaks.com/topic/192033-radio-button-checked-does-not-work-in-firefox/#findComment-1043682 Share on other sites More sharing options...
autoabacus Posted April 12, 2011 Share Posted April 12, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/192033-radio-button-checked-does-not-work-in-firefox/#findComment-1200502 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.