www.webdeveloper.com
Results 1 to 3 of 3

Thread: Change to disable radio

  1. #1
    Join Date
    Oct 2006
    Posts
    392

    Change to disable radio

    I have this code that disables checkboxes which works perfect but what I am trying to do is change the code to disable radio button instead of a checkbox how would I modify it to do this.
    Code:
    <script type="text/javascript">
    <!--
    
    
    function disableCheckBox() { 
            var obj=document.forms["form1"]; 
                for (i=0;i<obj.length;i++) { 
                    with (obj[i]) { 
                        if (type=='checkbox' && checked) { 
                            disabled=true; 
                        } 
                    } 
                } 
        }
    //-->
    </script>
    <body onload="disableCheckBox()">

  2. #2
    Join Date
    Oct 2006
    Posts
    392
    any ideas on this?

  3. #3
    Join Date
    May 2007
    Posts
    205
    change this

    Code:
    type=='checkbox'
    to this
    Code:
    type=='radio'

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles