El codigo del handler apply
Código:
/**/
function click_apply(target)
{
if(document.getElementById('proveedor').selectedIndex>0)
{
if (trim(document.getElementById('cantidad').value).length>0)
{
if (trim(document.getElementById('costo_unidad_compra').value).length>0 && document.getElementById('costo_unidad_compra').value>0)
{
clear_Node(target.parentNode.parentNode.childNode[3]);
target.parentNode.parentNode.childNode[3].appendChild(document.createTextNode(target.parentNode.parentNode.childNode[0].nodeValue*document.getElementById('cantidad').value));
clear_Node(target.parentNode.parentNode.childNode[4]);
target.parentNode.parentNode.childNode[4].appendChild(document.createTextNode(document.getElementById('cantidad').value));
clear_Node(target.parentNode.parentNode.childNode[5]);
target.parentNode.parentNode.childNode[5].appendChild(document.createTextNode(document.getElementById('costo_unidad_compra').value));
clear_Node(target.parentNode.parentNode.childNode[6]);
target.parentNode.parentNode.childNode[6].appendChild(document.createTextNode(document.getElementById('proveedor').options[document.getElementById('proveedor').selectedIndex].text+';'+document.getElementById('esquemas_descuentos').options[document.getElementById('esquemas_descuentos').selectedIndex].value));
document.forms[0].removeChild(document.getElementById('div_oscuro'));
document.forms[0].removeChild(document.getElementById('div_nuevo_registro'));
}
else{
alert('El costo no puede ser 0.00');
document.getElementById('costo_unidad_compra').value='0.00';
document.getElementById('costo_unidad_comopra').focu();
}
}
else{
alert('Especifique una cantidad');
document.getElementById('cantidad').value='';
document.getElementById('cantidad').focu();
}
}
else{
alert('Debe Seleccionar un proveedor');
document.getElementById('proveedor').focus();
}
}
En un solo post no me cupo jejje perdon, espero puedan ayudarme con esto