Wrox Programmer Forums
HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the HTML Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old November 28th, 2005, 09:40 AM
Friend of Wrox
Join Date: Nov 2005
Posts: 223
Thanks: 0
Thanked 0 Times in 0 Posts
Default readonly checkbox

Is there a way do disable switching te checkbox on/of and making it grey.

I want to create a grey checked checkbox.

When I use "disabled" in the input tag it doesn't submit the value of the checkbox.


This is my junk I'm gona eat it
Old November 28th, 2005, 09:44 AM
richard.york's Avatar
Wrox Author
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts

Use the readonly attribute:




Mail_IMAP: A PHP/C-Client/PEAR solution for webmail
Author: Beginning CSS: Cascading Style Sheets For Web Design
Old November 2nd, 2006, 07:53 AM
Registered User
Join Date: Nov 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts

Have a checkbox as follows:
<input type="checkbox" name="checkbox" OnClick="javascript:return ReadOnlyCheckBox()" />
Support the above with JavaSript as:
<script language="javascript" type="text/javascript">
    function ReadOnlyCheckBox()
        return false;
The above checkbox will not allow the user to change the state and even it will not appear in the Grey background (as Disabled).

Old November 10th, 2006, 08:34 AM
Friend of Wrox
Join Date: Nov 2005
Posts: 223
Thanks: 0
Thanked 0 Times in 0 Posts

thanks for the reply but I solved this problem all ready with the solution York has send me almost a year ago:D

__________________________________________________ ________
This is my junk I'm gona eat it

Similar Threads
Thread Thread Starter Forum Replies Last Post
Recordset is readonly vb.net-newbie ADO.NET 1 May 8th, 2007 11:12 AM
DataBase is readonly debabrata ASP.NET 2.0 Professional 0 April 17th, 2007 04:54 AM
checkbox checked by default by html:checkbox sachin.tathod Struts 3 December 4th, 2006 03:41 PM
Readonly checkbox nerssi HTML Code Clinic 1 May 20th, 2005 06:28 AM
Set all textboxes to ReadOnly nobreferreira Pro VB.NET 2002/2003 6 October 15th, 2004 01:02 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.