Cita:
Iniciado por cancer_15_4_9
Es es el codigo que gener le cambie en evento al input y probe tambien con el evento que pusiste pero nada.
Ah y el segundo codigo ahi no se que. Donde lo debo de poner. Espero me puedas ayudar
Deberia de funcionar con el onChange, siempre cada vez que no te funcione depura linea por linea y asi mejor aun aprenderas:
Código PHP:
<?php
if (isset($_POST['variable'])){
$bd_host = "BEREESSEC-PC\SQLEXPRESS";
$bd_usuario = "sa";
$bd_password = "123456";
$bd_base = "SERCAP";
$con = mssql_connect($bd_host, $bd_usuario, $bd_password);
mssql_select_db($bd_base, $con);
//consulta todos los empleados
if(isset($_POST['txtId_matriz'])) {
$id = $_POST['txtId_matriz'];
$sql = mssql_query("SELECT * FROM TMatrizAdoctrinamientoEncabezado where Id_matriz='$id'",$con);
while($row = mssql_fetch_array($sql)){
$revision = $row['Revision'];
}
} else {
echo 'txtId_matriz no esta definico.';
}
} else {
echo 'variable no esta un definido.<br>';
}
?>
<form id='forma' method="post" action="formulario.php">
<table>
<tr>
<td>
<input type="text" name="txtId_matriz" onChange="if(this.value!=''){ alert('Saldra para submit!!!!'); document.getElementById('forma').submit(); }"/>
</td>
</tr>
<tr>
<td>
<input type="text" name="Revision" value="<?php if(isset($revision)) echo $revision; ?>"/>
</td>
</tr>
</table>
</form>
Saludos