javascript - Alternative toif (elem.changed == 'true') -


i think if (elem.changed == 'true') incompatible ie because since did update our server , work without compatibility mode, function isnt working since elem.change "undefined". options can in way dont have modify code alot?

function gravatabela(numregs, dia) {    var params = '';    url = '';      (k = 0; k < numregs; k++) {      url = '';      vsend = true;      elem = document.getelementbyid("tr" + k);      if (elem.changed == 'true') {        inputs = elem.getelementsbytagname("select");        params = '?lineid=' + k;        (var = 0; < inputs.length; i++) {          if (inputs[i]) {            params += '&' + inputs[i].name + '=' + inputs[i].value;            }        }          inputs = elem.getelementsbytagname("span");        (var = 0; < inputs.length; i++) {          if (inputs[i]) {            params += '&' + inputs[i].name + '=' + inputs[i].innertext;            }        }          inputs = elem.getelementsbytagname("input");        (var = 0; < inputs.length; i++) {          if (inputs[i]) {            if (inputs[i].type == "checkbox") {              //alert(i);                params += '&' + inputs[i].name + '=' + (inputs[i].checked ? "1" : "0");              //alert(params);            } else {              if (inputs[i].juntadia) {                if (inputs[i].value && inputs[i].value != '') {                  if (inputs[i].length == 0 || validahorasstr(inputs[i].value))                    params += '&' + inputs[i].name + '=' + inputs[i].juntadia + ' ' + inputs[i].value + ':00';                  else {                    vcampo = '';                    if (inputs[i].name == "efec_ent")                      vcampo = 'hora de entrada (efectiva)';                    if (inputs[i].name == "efec_sai_alm")                      vcampo = 'hora de saida para almoço (efectiva)';                    if (inputs[i].name == "efec_reg_alm")                      vcampo = 'hora de regresso de almoço (efectiva)';                    if (inputs[i].name == "efec_saida")                      vcampo = 'data de saída (efectiva)';                    updatepage(k + '$ko$erro nos dados enviar: o campo ' + vcampo + ' não está correcto.');                    vsend = false;                  }                } else                  params += '&' + inputs[i].name + '=';                  //alert(inputs[i].juntadia + ' ' + inputs[i].value + ':00');              } else                params += '&' + inputs[i].name + '=' + inputs[i].value;              }          }        }        if (vsend) {          url = 'grupo4_pantalla6_upd.jsp' + params;          //alert(url);          xmlhttppost(url);        }        //alert(url);      }    }      }

i think can use onchange event in html this:

<select onchange="myfunction()">

even jquery compatible browsers.


Comments