I have a form in which I need to disable an array of checkboxes and a few fields so that the user cannot change/alter their values. When I submit the form though, the POST values of the disabled elements are missing/null. How can I manage what I'm trying to do without this problem?
Right now I'm disabling the fields by disabling the container div like this:
#unselectable {
-moz-user-select: -moz-none;
-khtml-user-select: none;
-webkit-user-select: none;
-o-user-select: none;
-webkit-user-select: none;
cursor:not-allowed;
}
Well, there are 3 solutions I can think of:
readonly
by adding the readonly
property to the element.Take your pick :)