Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jan 2006
    Posts
    377
    Thanks
    8
    Thanked 1 Time in 1 Post

    Untickable checkboxes

    I need to use untickable checkboxes. They should start as checked remain checked when trying to untick them. How is this possible?

  • #2
    Senior Coder
    Join Date
    Nov 2006
    Posts
    1,000
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Try

    <input type="checkbox" name="cb" checked="checked" onclick="return(false);" />

    david_kw

  • #3
    Regular Coder
    Join Date
    Jan 2006
    Posts
    377
    Thanks
    8
    Thanked 1 Time in 1 Post
    That works as expexted. Thank you very much, David.

  • #4
    Senior Coder
    Join Date
    Feb 2003
    Posts
    1,665
    Thanks
    0
    Thanked 27 Times in 25 Posts
    Bear in mind that this isn't going to work for non-js users.
    If it's for a legal consent/agreement checkbox, then you might consider other ways to 'enforce' the condition or validate the state of the checkbox.

    Just a heads up.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •