Ver Mensaje Individual
  #7 (permalink)  
Antiguo 26/03/2012, 06:36
Avatar de IsaBelM
IsaBelM
Colaborador
 
Fecha de Ingreso: junio-2008
Mensajes: 5.032
Antigüedad: 15 años, 10 meses
Puntos: 1012
Respuesta: formulario que se envie al pulsar intro

podrías haber dicho antes que estás usando ajax
Cita:
function contador (valor, largo) {
document.getElementById('remLen').value = valor.length % largo != 0 ? parseInt(largo - valor.length) : 0 ;
}


function onEnter(ev, f) {
var key = (ev) ? ev.keyCode : ev.charCode;
if(key == 13) {
try{
ev.preventDefault();
}catch(e){
ev.returnValue = false;
}
enviarDatosEmpleado(f);
}
}


<form name="frmempleado" onsubmit="enviarDatosEmpleado(this); return false">
<input name="idempleado" type="hidden" value="<?php echo $idemp; ?>" />
<textarea name="sueldo" wrap=physical cols="28" rows="1" maxlength="150" onkeypress="onEnter(event, this.form);" onKeyUp="contador(this.value, this.maxLength);" onClick="if(this.value == '<?php echo $suel; ?>')this.value = '';"><?php echo $suel; ?></textarea>
<input type="text" id="remLen" name="remLen" size="3" value="150" readonly>
<input type="submit" name="Submit" value="Actualizar" />
</form>
__________________
if(ViolenciaDeGénero) {alert('MUJER ASESINADA');}