CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2003
    Posts
    5

    Question Locking a CheckBox in HTML

    Hi all,


    I have to lock a Checkbox in HTML, I don't want to disable it since it spoils the look of the site, is there any way to lock it as though we do with a textbox, if so How Can Anyone plz help on this

    Regards
    Raj
    Regards
    Raj

  2. #2
    Join Date
    Jan 2003
    Location
    North Carolina
    Posts
    309
    I usually try to control what can happen. Most times I want the item to be able to be set on but no off so I do like so.

    Code:
    <SCRIPT LANGUAGE=JAVASCRIPT>
    	var IsClicked = 0;
    	
    	function SetClick()
    	{
    		if (IsClicked) 
    			BOB.checked = true;
    		else
    			IsClicked=1;
    	}
    	
    </SCRIPT>
    
    <INPUT TYPE=checkbox NAME=BOB OnClick="SetClick()">Test
    This will allow to be set on but trying to click off just sets value on.

    Not sure of any other way to do what you ask.

  3. #3
    Join Date
    Feb 2003
    Posts
    5

    Thumbs up Thank You

    Thanks anyway I will try to build the logic from here

    regards
    Raj
    Regards
    Raj

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured