[How to make] Check box Non Editable/Non Selectable? without using entry "disabled"

2 replies
  • WEB DESIGN
  • |
I want to make the check box checked, and Non Editable/Non Selectable



Step 1. checked the check box only
from this tutorial page hscripts.com/tutorials/html/form-checkbox.php its working checked by add entry "checked" in bold below, and the form working with the check box checked after click submit button :

<input type="checkbox" checked name="postpoll" value="yes" id="cb_postpoll" tabindex="1" $checked[postpoll] />


Step 2. make it Non Editable/Non Selectable, so the check box are already checked and cannot unchecked by users

from that same tutorial page its says to add entry "disabled" like below in bold

<input type="checkbox" checked disabled name="postpoll" value="yes" id="cb_postpoll" tabindex="1" $checked[postpoll] />
its working the check box being Non Editable/Non Selectable, but after click submit button the form are not working maybe because the check box really disabled, its just pass the checked check box, like there is no check box. Maybe using entry "disabled" is the wrong way






please help guys, how to make the form still working after click submit button, but the check box are already checked and cannot unchecked by users
#box #check #disabled #editable or non #entry #make #selectable
  • Profile picture of the author basketmen
    up up


    somebody suggest this in bold, i think this is the best way if i know how to do that, any body know how to do that?


    Why do you need to show such a checkbox in this case? If it's to checked and cannot be altered, then can't you just assume the value of as yes, in the serverside?

    FYI: There's nothing permanent when it comes in the client side. Users can easily manipulate the html code from their browser using tools like firebug.
    {{ DiscussionBoard.errors[3079172].message }}
  • Profile picture of the author Ambius
    you could use input type="hidden" instead of a disabled checkbox. but as your quote says, if you don't want people to alter an input then don't even include the input on the form because they can easily modify even a hidden or disabled input with client-side javascript in firebug or greasemonkey. For security reasons, your action page that processes the input should assume a default value.
    {{ DiscussionBoard.errors[3081204].message }}

Trending Topics