Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9256415
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:56:08+00:00 2026-06-18T11:56:08+00:00

Below I have a checkbox which is styled like a button: echo ‘<p>’; foreach($options

  • 0

Below I have a checkbox which is styled like a button:

 echo '<p>';
 foreach($options as $indivOption) {
     echo '<div id="ck-button"><label><input type="checkbox" name="options[]" id="option-' . $indivOption . '" value="' . $indivOption . '" /><span>' . $indivOption . '</span></label></div>';
 }
  echo '</p>';

Now what happens is that if I click on the checkbox button quickly twice, it turns on the button but then it does not turn it off, it instead does a little text selection on the button. So if I have button known as E, if I click it twice quickly, it turns the button on and then it highlights the letter E.

My question is that for only the checkbox buttons, how in javascript as I assume it is client side to sort this out, how to prevent the text selection from happening only for the checkbox buttons, not for the whole document.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T11:56:09+00:00Added an answer on June 18, 2026 at 11:56 am

    Apply this style to the check buttons (or, in your case, the div containing the check buttons):

    #ck-button {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -khtml-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    

    For browsers < IE10, add the property onselectstart="return false;" to the ck-button div.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I have a checkbox which has this name attribute below: name=answerName[True] How come
I have form fields which are checkboxes as below : <input id=abirrules@gmail.com type=checkbox checked=checked
The dialog below displays a checkbox which on selected enables the Next Button. The
I have the below jqgrid image, from which I would like to remove the
I have an example below which has a terms div which has some terms
I have added checkbox in display table using decorator class as shown in below
I have a code snippet as below <CheckBox Name=cb Margin=1,2,1,0 IsChecked={Binding Path=IsManager} IsEnabled=True/> Consider
If any of the nested div s below have a length longer then an
Below I have a function that animates a div ( container ) either to
Below I have a line of code where it states which Session a user

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.