Bug 161272

Summary: [testcase] Konqueror shouldn't allow several radio controls to be checked
Product: [Applications] konqueror Reporter: Christophe Marin <christophe>
Component: khtml formsAssignee: Konqueror Developers <konq-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: markusk
Priority: NOR    
Version: SVN   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: testcase

Description Christophe Marin 2008-04-25 20:46:26 UTC
Version:           4.00.71 (KDE 4.0.71 (Alpha1) (using 4.00.71 (KDE 4.0.71 (Alpha1), compiled sources)
Compiler:          gcc
OS:                Linux (i686) release 2.6.24-16-generic

This bug is *not* a duplicate of bug 89363 (different testcase) :-)

kdelibs rev. 801095.

Testcase :

<html>
<body>
  All these buttons have the same "name" value.<br>
  <form action="http://bugs.kde.org">
    <input type="radio" name="RadioButton" checked="checked"> Button #1 <br>
    <input type="radio" name="RadioButton" checked="checked"> Button #2 <br>
    <input type="radio" name="RadioButton" checked="checked"> Button #3 <br>
    <input type="radio" name="RadioButton" checked="checked"> Button #4 <br>
  </form>
  </body>
</html>

There are two differences with 89363 :
- The controls are in a form
- the checked option is used.

With this testcase, all buttons will be checked in Konqueror while w3c mentions : «Radio buttons are like checkboxes except that when several share the same control name, they are mutually exclusive: when one is switched "on", all others with the same name are switched "off"» (http://www.w3.org/TR/html401/interact/forms.html / 17.2.1).

I guess konqueror should make a choice to display only one checked button.
Comment 1 Christophe Marin 2008-04-25 20:48:23 UTC
Created attachment 24503 [details]
testcase

Testcase with "value" set.
Comment 2 Markus Kohls 2008-05-23 15:46:34 UTC
I can confirm this with Konqueror 4.0.4. There's the same error on www.gaspricewatch.com (select radio buttons with same name for search time interval of stations). They are not mutually exclusive, which makes the search unusable. 
Comment 3 Eduardo Robles Elvira 2008-05-23 15:50:15 UTC
I can confirm this bug too in SVN trunk, rev 811382.
Comment 4 Markus Kohls 2009-01-07 03:13:22 UTC
This is fixed in recent SVN (KDE4Daily for KDE4.2)
Comment 5 Stas Verberkt 2009-02-26 22:55:07 UTC
SVN commit 932558 by sverberkt:

Don't allow multiple radiobuttons to be checked on default.

BUG:161272


 M  +17 -8     html_formimpl.cpp  
 M  +3 -2      html_formimpl.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=932558
Comment 6 Maksim Orlovich 2009-03-21 16:23:44 UTC
SVN commit 942337 by orlovich:

Merged revision:r932558 | sverberkt | 2009-02-26 16:55:05 -0500 (Thu, 26 Feb 2009) | 4 lines

Don't allow multiple radiobuttons to be checked on default.

BUG:161272

 M  +17 -8     html_formimpl.cpp  
 M  +3 -2      html_formimpl.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=942337