1

How to change the code to fit jquery version my jquery version was v1.4.2. When i upgraded didnt work no more. need help to fix it. found the migrate.js but dodnt want to use it. this is my code:

$(document).ready(function () {
var mrTables = $(".mrQuestionTable");
/* var mrTables = $("table.mrQuestionTable"); in DC 7.0 is not a table */

mrTables.each(function () {
    var tbl = $(this);
    var tblTds = tbl.find("td");
    var isGrid = false;
    if (tblTds.eq(1).attr("class") != null ) {
        isGrid = tblTds.length > 1 &&  tblTds.eq(1).attr("class").indexOf("Grid") >= 0 ;
    }
    var tblInps = tbl.find('INPUT[type="checkbox"].mrMultiple');
    tblInps.each(function () {
        var inp = $(this);
        this.group = isGrid ?    /* group of checkboxes */
            inp.closest('tr').get(0) /* when is grid, group is closest row */
            : tbl.get(0);   /* else table */
        this.isNotMulti = inp.attr("name").indexOf("nmult") >= 0;
        inp.change(clearAnswers);   
    }
  );
});

});

and this is clearAnswers function:

function clearAnswers(e) {
var el = e.target;
if (!el.checked)
    return;
var inps = $(el.group).find('INPUT[type="checkbox"][group].mrMultiple');
    // when is grid uncheck only in the same row

inps.each(function () {
    //  if checked element is notMulti unckeck all else  uncheck all notMutli 
    if (this != el && (el.isNotMulti || this.isNotMulti))
        this.checked = false;
});

}

Actually, the migrate.js didnt work either

Joz
  • 11
  • 3

0 Answers0