Radio button issue on Firefox

2 posts by 2 authors in: Forums > CMS Builder
Last Post: January 13, 2014   (RSS)

By paulmac - January 9, 2014

Hi

I have the following code that allows users to subscribe to a mailing list:

<label>
yes <input name="mailing_list" value="1" <?php checkedIf(@$_REQUEST['mailing_list'], '1') ?> type="radio" />
no  <input name="mailing_list" value="0" <?php checkedIf(@$_REQUEST['mailing_list'], '0') ?> type="radio" />
</label>

It works okay in IE and Chrome, but not in FF. When a user clicks "No" in FF the "Yes" button is highlighted.

Any ideas on what the problem could be?

Thanks

By Damon - January 13, 2014

Hi,

Found this thread online that discussed the issue and it looks like it has to do with having both radio button <input > elements inside the same <label> tag:

http://forums.mozillazine.org/viewtopic.php?f=38&t=575763&start=0

I changed the code to this and it worked in Firefox:

<label>
    yes <input name="mailing_list" value="1" <?php checkedIf(@$_REQUEST['mailing_list'], '1') ?> type="radio" />
</label>
<label>
    no  <input name="mailing_list" value="0" <?php checkedIf(@$_REQUEST['mailing_list'], '0') ?> type="radio" />
</label>

Hope this helps!

Cheers,
Damon Edis - interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/