js/insertVote.js
// Compute local total for a given question
Compute local total for a given question
Compute local total for a given question
function computeTotal(e) {
    var input     = $(e.currentTarget);
    var sgqa      = input.data("sgqa");
    var startSgqa = sgqa.split('SQ')[0];
    var total     = 0;
    var totalEl   = FORM.find('input[name="total-'+ startSgqa +'"]');
    FORM.find('input[name^="'+ startSgqa +'"]').each(function(idx, el) {
      total += Number(el.value);
    });
    totalEl.val(total);
  }
function computeTotal ( e ) { var input = $ ( e . currentTarget ) ; var sgqa = input . data ( "sgqa" ) ; var startSgqa = sgqa . split ( 'SQ' ) [ 0 ] ; var total = 0 ; var totalEl = FORM . find ( 'input[name="total-' + startSgqa + '"]' ) ; FORM . find ( 'input[name^="' + startSgqa + '"]' ) . each ( function ( idx , el ) { total += Number ( el . value ) ; } ) ; totalEl . val ( total ) ; }
Compute local total for a given question
Compute local total for a given question