Strange Checkbox behaviour

Hello,

i am now banging my head for about 2 hours.

<label><input name="" type="checkbox" value="1" />yes</label>
<label><input name="" type="checkbox" value="0" />no</label>

if i click one check box, other one also getting selected auto. very annoying :rolleyes:

Why do they both have the same name value?

That code on its own doesn’t create that behavior—not in my browser anyhow. Post an actual example that demonstrates the behavior:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
</head>
<body>

<label><input name="" type="checkbox" value="1" />yes</label>
<label><input name="" type="checkbox" value="0" />no</label>

</body>
</html>

ok , i just grabed the actual code from my script

<label>
<input type="checkbox" name="checkbox" id="checkbox" value="a" />
A
</label>

<label>
<input type="checkbox" name="checkbox2" id="checkbox2" value="b" />
B
</label>

Did you see my post? That code on its own is not likely to be the problem.

hai ralph.
can you kindly check this code in your browser?


<div id="alpha" style="border:1px solid black;">
<label>
<input type="checkbox" name="" id="checkbox" value="a" />
A
</label>

<label>
<input type="checkbox" name="" id="checkbox2" value="b" />
B
</label>

<label>
<input type="checkbox" name="" id="checkbox3" value="c"/>
C
</label>

<label>
<input type="checkbox" name="" id="checkbox4" value="d"/>
D
</label>

<label>
<input type="checkbox" name="" id="checkbox5" value="e"/>
E
</label>

<label>
<input type="checkbox" name="" id="checkbox6" value="f"/>
F
</label>

<label>
<input type="checkbox" name="" id="checkbox7" value="g"/>
G
</label>

<label>
<input type="checkbox" name="" id="checkbox8" value="h"/>
H
</label>

<label>
<input type="checkbox" name="" id="checkbox9" value="i"/>
I
</label>

<label>
<input type="checkbox" name="" id="checkbox10" value="j"/>
J
</label>

<label>
<input type="checkbox" name="" id="checkbox11" value="k"/>
K
</label>

<label>
<input type="checkbox" name="" id="checkbox12" value="l"/>
L
</label>

<label>
<input type="checkbox" name="" id="checkbox13" value="m"/>
M
</label>

<label>
<input type="checkbox" name="" id="checkbox14" value="n"/>
N
</label>

<label>
<input type="checkbox" name="" id="checkbox15" value="o"/>
O
</label>

<label>
<input type="checkbox" name="" id="checkbox16" value="p"/>
P
</label>

<label>
<input type="checkbox" name="" id="checkbox17" value="q"/>
Q
</label>

<label>
<input type="checkbox" name="" id="checkbox18" value="r"/>
R
</label>

<label>
<input type="checkbox" name="" id="checkbox19" value="s"/>
S
</label>

<label>
<input type="checkbox" name="" id="checkbox20" value="t"/>
T
</label>

<label>
<input type="checkbox" name="" id="checkbox21" value="u"/> 
U
</label>

<label>
<input type="checkbox" name="" id="checkbox22" value="v"/>
V
</label>

<label>
<input type="checkbox" name="" id="checkbox23" value="w"/>
W
</label>

<label>
<input type="checkbox" name="" id="checkbox24" value="x"/>
X
</label>

<label>
<input type="checkbox" name="" id="checkbox25" value="y"/> 
Y
</label>

<label>
<input type="checkbox" name="" id="checkbox26" value="z"/> 
Z
</label>
</div>

Thank you folks for the valuable time you took to solve my issue.

i just found the problem.
the problem is just above the group of this check boxes, an un closed </lable> tag is what caused all the problem

<label><strong>COMBINATOR</strong>// << [COLOR="#FF0000"]Lable not closed, this is what caused the problem
<br />[/COLOR]
<br />
Please select few charactors and click generate.<br />
<span class="style1">*Selecting more than 7 characters is not recommended</span>
<br />
<br />
<br />

<div id="alpha" style="border:1px solid black;">
<label>
<input type="checkbox" name="A" id="A" />
A</label>
<label>
<input type="checkbox" name="B" id="B" />
B</label>
<label>




Hehe, thought it might be something like that. :slight_smile: