Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Read-only check boxes

Status
Not open for further replies.

programmher

Programmer
Joined
May 25, 2000
Messages
235
Location
US
This should be a simple issue; but I am unable to make my checkboxes un-editable. Here is an example of my code:

<input type=&quot;checkbox&quot; name=&quot;clientnumber&quot; value=&quot;Yes&quot; <Cfif &quot;#clientnumber#&quot; EQ &quot;Yes&quot;>checked</cfif>>Client Number

If the database value of &quot;clientnumber&quot; is true, the value is reflected as true. If the value is true, I do not want the user to be able to change it on the form (although any changes won't be updated to the database).

I've tried the &quot;readonly&quot; option but it does not work. What am I missing?
 
Here's one way to do it:

[COLOR=000080][COLOR=CC3300]<input type=&quot;checkbox&quot; name=&quot;clientnumber&quot; value=&quot;Yes&quot;
onfocus=&quot;vChecked = this.checked; this.blur()&quot;
onclick=&quot;this.checked = vChecked; this.blur()&quot;
<cfif clientnumber EQ &quot;Yes&quot;>[/color][/color]checked</cfif>>
Client Number - tleish
 
Thanks a million, tleish! That worked &quot;like a charm&quot;!

-P
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top