Ver Mensaje Individual
  #12 (permalink)  
Antiguo 09/01/2013, 14:23
Anarko
 
Fecha de Ingreso: febrero-2004
Mensajes: 1.987
Antigüedad: 20 años, 3 meses
Puntos: 22
Respuesta: Cómo cambiar VALUE de un campo SELECT en el evento onsubmit() ???

Cita:
Iniciado por David Ver Mensaje
Da error porque olvidé poner el nombre del select.
David adicione la línea al FORM:
Código PHP:
<form action="" id="formfact2" 
onsubmit="if(document.forms.formfact2.fact_pagada.value!=1){ 
this.fact_pagada.options[this.fact_pagada.selectedIndex].value = 'Cambiado!';
alert(document.forms.formfact2.fact_pagada.value);
return false;
}"
><select name="fact_pagada"><option value="Algo1">Algo 1</option><option 
value
="Algo2">Algo 2</option></select><input type="submit" value="GuardarFactura" class="b" /></form
Pero cambia el VALUE para TODAS LAS OPTIONS.

Gracias