Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
Hi Expert!
I have one checkbox that checked and unchecked on description click.
My code as par below
<input type="checkbox" id="chkId" />
<label for="chkId">Check</label>
It work fine with all browsers besides Mozilla (all version), when user click continue on checkbox's description (Mozilla) and on Internet Explorer 10, it work slowly, when user
clicked and unchecked. Why? This is very irritable.
Please give me solution that (checkbox) work properly on all browsers.
Please help me!
Any suggestion will be appreciated.
Thanks in advance!
Posted 8-Mar-13 1:04am
Edited 8-Mar-13 7:40am
ryanb31 at 8-Mar-13 7:20am
Where's the code?
Zoltán Zörgő at 8-Mar-13 13:03pm
Is it bare html, or is there any javascript event handler attached?
Try it out as bare html also: just save these two lines in a test.html and see.
I have experienced that there is some slowness in Mozilla, but that was around 300ms - somewhat more than with Chrome, but acceptable.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Here is the simple solution:
You should not use Label at all, because it is redundant; the check box has its own text. Do something like this:
<input type="checkbox" id="chkId1" accesskey="A">This is option <u>A</u></input><br/>
<input type="checkbox" id="chkId2" accesskey="B">This is option <u>B</u></input>
This way, you will create accelerator keys for each control, according to underlined characters. Remember that in Mozilla, they are accessed via Alt+Shift+key, but on some other browsers via Alt+key.
As to the slow operation, this is not true. You could screw up your performance somewhere else; those controls themselves work just fine, and very fast.
Pravesh Singh at 9-Mar-13 3:46am
I kanow, it work fine when we click on checkbox, but i want to checked checkbox on checkbox text(e.g. "This is option A") click, this work not properly when user continue click on checkbox text.
Sergey Alexandrovich Kryukov at 9-Mar-13 19:54pm
What is not working properly? It all depends on what you write in the handler. In detail please, what's not working. What exactly do you want to achieve?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 455
1 Sergey Alexandrovich Kryukov 312
2 DamithSL 179
3 King Fisher 179
4 Peter Leow 154
0 OriginalGriff 240
1 Maciej Los 95
2 Sascha Lefévre 85
3 King Fisher 70
4 F-ES Sitecore 55

Advertise | Privacy | Mobile
Web01 | 2.8.150327.1 | Last Updated 8 Mar 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100