
paso de variables javascript a html
Publicado por JHON FIGUEROA (18 intervenciones) el 11/12/2010 07:49:57
Hola necesito que alguien me colabore con este codigo, necesito enviar unas variables td2, td3 a HTML : td2 a select operario, td3 a select formularioing, al momento de ejecutarlo no me esta enviando las variables al HTML, o me envia unas variables diferentes :
<script language="javascript" type="">
function restablecer(){
document.forms["form1"]["Enviar"].disabled=true;
}
function verifica(){//verifica que el contenido ingresado sea valido
Operario=document.getElementById("Operario").value;
formulario=document.getElementById("formularioing").value;
if(Operario==0 || formulario==0){
document.forms["form1"]["Enviar"].disabled=true;
}else{
document.forms["form1"]["Enviar"].disabled=false;
}
}
function activarequiere(){
requiere = document.getElementById("requiere").value;
document.forms["form1"]["identifica"].value = 0;
document.getElementById("Operario").value = 0;
document.getElementById("formularioing").value = 0;
}
function volcar_valores(elemento){
requiere = document.getElementById("requiere").value;
if (requiere==1){
alert("ESTA FUNCION NO ESTA PERMITIDA PARA INGRESAR NUEVOS DATOS");
document.forms["form1"]["identifica"].value = 0;
document.getElementById("Operario").value = 0;
document.getElementById("formularioing").value = 0;
}else{
var td = elemento.id;
var a = "a"+td;
var b = "b"+td;
var d = "d"+td;
var td1 = document.getElementById(a).innerHTML;
var td2 = document.getElementById(b).innerHTML;
var td3 = document.getElementById(d).innerHTML;
document.forms["form1"]["identifica"].value = td1;
document.getElementById("Operario").value =td2;
document.getElementById("formularioing").value = td3;
//alert(document.getElementById("Operario").value);
//alert(document.getElementById("formulario").value);
document.forms["form1"]["Enviar"].disabled=false;
}
}
function enviarparametro(valor){
location = location.pathname + '?Operarios=' + valor;
}
window.onload = function(){
document.getElementById('Operarios').onchange = function(){
enviarparametro(this.value);
}
}
</script>
anteriormente ya habia pasado las variables utilizando document.getElementById(" NOMBRE DEL OBJETO HTML").value =VARIABLE ; y no he tenido problemas......
ESPERO ME COLABOREN
<script language="javascript" type="">
function restablecer(){
document.forms["form1"]["Enviar"].disabled=true;
}
function verifica(){//verifica que el contenido ingresado sea valido
Operario=document.getElementById("Operario").value;
formulario=document.getElementById("formularioing").value;
if(Operario==0 || formulario==0){
document.forms["form1"]["Enviar"].disabled=true;
}else{
document.forms["form1"]["Enviar"].disabled=false;
}
}
function activarequiere(){
requiere = document.getElementById("requiere").value;
document.forms["form1"]["identifica"].value = 0;
document.getElementById("Operario").value = 0;
document.getElementById("formularioing").value = 0;
}
function volcar_valores(elemento){
requiere = document.getElementById("requiere").value;
if (requiere==1){
alert("ESTA FUNCION NO ESTA PERMITIDA PARA INGRESAR NUEVOS DATOS");
document.forms["form1"]["identifica"].value = 0;
document.getElementById("Operario").value = 0;
document.getElementById("formularioing").value = 0;
}else{
var td = elemento.id;
var a = "a"+td;
var b = "b"+td;
var d = "d"+td;
var td1 = document.getElementById(a).innerHTML;
var td2 = document.getElementById(b).innerHTML;
var td3 = document.getElementById(d).innerHTML;
document.forms["form1"]["identifica"].value = td1;
document.getElementById("Operario").value =td2;
document.getElementById("formularioing").value = td3;
//alert(document.getElementById("Operario").value);
//alert(document.getElementById("formulario").value);
document.forms["form1"]["Enviar"].disabled=false;
}
}
function enviarparametro(valor){
location = location.pathname + '?Operarios=' + valor;
}
window.onload = function(){
document.getElementById('Operarios').onchange = function(){
enviarparametro(this.value);
}
}
</script>
anteriormente ya habia pasado las variables utilizando document.getElementById(" NOMBRE DEL OBJETO HTML").value =VARIABLE ; y no he tenido problemas......
ESPERO ME COLABOREN
Valora esta pregunta


0