Trying to protect a checkbox using readonly - NOT WORKING!

Below is a sample of my source.  I cannot figure out why the checkbox does not show up PROTECTED on my form.  Would appreciate any comments!

<cfset LockFld = "Y">
<cfif #LockFld# IS NOT "Y">
<INPUT TYPE="checkbox" name="Limits1" <cfif getPS1.Limits IS 1>Checked</cfif>>
<INPUT TYPE="checkbox" name="Limits1"  readonly <cfif getPS1.Limits IS 1>Checked</cfif>>
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I have always used disabled instead of readonly - because of the following,...quote from (

"It's important to understand that READONLY merely prevents the user from changing the value of the field, not from interacting with the field. For many types of fields, READONLY is irrelevent because you don't normally change the value. In checkboxes, for example, you can check them on or off (thus setting the CHECKED state) but you don't change the value of the field. DISABLED, however, actually prevents you from using the field."

If you want the "look" of a normal checkbox,...but the appearance of read only field (like a readonly text input) you can use a javascript function to undo the click when a user clicks a checkbox that you want to be read-only.

I can provide the code if required.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
as bwasyliuk pointed out above...what you are looking for is DISABLED and not READONLY
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Servers

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.