www.webdeveloper.com
Results 1 to 2 of 2

Thread: Assignment

Hybrid View

  1. #1
    Join Date
    May 2013
    Posts
    1

    Assignment

    Hey everyone , I have a university assignment

    Which i am stuck on a few things for javascript , can anyone please help me out ??

    Appropriate input devices that allow multiple selections of these
    items. Selection or non selection of values for these items set
    the display rules for its subsections as follows:
    B Already selected and input devices b1 to b5
    activated.
    C Initially not selected and subsections c1 to c11 are
    inactive. If C is selected in subsections are activated.
    D - Initially not selected and subsection d1 is inactive. If
    D is selected d1 becomes active.
    E - Initially not selected and subsections e1 to e3 are
    inactive. If E is selected in subsections are activated.

    If anyone actually responds i will gladly tell them more about it ?

  2. #2
    Join Date
    Sep 2007
    Location
    istanbul
    Posts
    317
    Code:
      
    
    <html>
    <head>
    <script type="text/javascript">
    // http://www.w3schools.com/jsref/jsref_split.asp
    // http://www.w3schools.com/html/tryit.asp?filename=tryhtml_checkbox
    // http://www.w3schools.com/jsref/dom_obj_checkbox.asp
    // http://www.w3schools.com/jsref/prop_checkbox_checked.asp
    // http://www.w3schools.com/jsref/prop_checkbox_disabled.asp
    // http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_checkbox_disabled
    // http://www.w3schools.com/tags/att_input_disabled.asp
    // http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_input_disabled
    
    function tercih (bu) {
    var A = bu.value.split(/,/g);
    var el, i;
    
    for(i=0; i<A.length; i++) {
    el= document.getElementById(A[i]);
    el.disabled = !bu.checked;
    el.checked = bu.checked;
    }
    }
    </script>
    </head>
    <body>
    
    <input type="checkbox" name="c" value="c1,c11" onclick="tercih( this )">C<br>
    <input type="checkbox" name="c1" id='c1' value="" disabled>C1 <br>
    <input type="checkbox" name="c11" id='c11' value="" disabled>C11 <br>
    </body>
    </html>

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