he logrado convertir el script en una sola llamada a funcion pero no logro simplificarlo creo que 1 llamada a funcion para cada elemento es mucho.
Código Javascript
:
Ver originalvar global= new Array(0, 0, 0, 0, 0);
function calcula1(data, elemSelect, indiceArray){
var pfrs= data.options[data.selectedIndex].value;
document.form1.frs.value = pfrs;
var pointset= parseInt(elemSelect.options[elemSelect.selectedIndex].text);
var datpast= global[indiceArray];
var atrset= document.getElementById("atr");
var atrpoint= parseInt(atrset.value);
atrpoint=atrpoint-datpast;
atrset.value=atrpoint+pointset;
global[indiceArray]=pointset;
document.form1.pdes.disabled=this.value!='';
}
function calcula2(data, elemSelect, indiceArray){
var pdes= data.options[data.selectedIndex].value;
document.form1.des.value = pdes;
var pointset= parseInt(elemSelect.options[elemSelect.selectedIndex].text);
var datpast= global[indiceArray];
var atrset= document.getElementById("atr");
var atrpoint= parseInt(atrset.value);
atrpoint=atrpoint-datpast;
atrset.value=atrpoint+pointset;
global[indiceArray]=pointset;
document.form1.pdes.disabled=this.value!='';
}
function calcula3(data, elemSelect, indiceArray){
var psab= data.options[data.selectedIndex].value;
document.form1.sab.value = psab;
var pointset= parseInt(elemSelect.options[elemSelect.selectedIndex].text);
var datpast= global[indiceArray];
var atrset= document.getElementById("atr");
var atrpoint= parseInt(atrset.value);
atrpoint=atrpoint-datpast;
atrset.value=atrpoint+pointset;
global[indiceArray]=pointset;
document.form1.psab.disabled=this.value!='';
}
alguna idea?