Trying to protect a checkbox using readonly - NOT WORKING!

Posted on 2004-11-22
Last Modified: 2013-12-24
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>>
Question by:sulzener
    LVL 7

    Accepted Solution

    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.

    LVL 5

    Expert Comment

    as bwasyliuk pointed out above...what you are looking for is DISABLED and not READONLY

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
    Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now