1. The 3.8 code for Fabrik is now available on github, in the 'master' branch. If you are familiar with updating Fabrik from github, we would appreciate it if you could test this code on J! 3.8 for us. Once we have some feedback, we'll build a 3.8 release.

Select a radio / checkbox in JS

Aug 5, 2013
Select a radio / checkbox in JS
  • Code (Javascript):
    // get the div that contains the checkboxes
    // this div is the element which uses the elemnent's full name as its id.
    var div = $('tablename___elementname');
     
    //get its checkboxes
    var inputs = div.getElements('input[type=checkbox]');
     
    //or to get radiobuttons
    var inputs = div.getElements('input[type=radio]');
     
    //access a specific input and see if its checked or not
     
    if(inputs[0].checked){
        alert('the first input is checked')
    } else {
        alert('the first input in not checked');
    }