Tengo una funcion PHP que cargo con LOAD. Esta funcion verifica si un dato existe.
Si existe debe activar el boton enviar si no lo debe desactivar.
Anexo el codigo :
Código HTML:
<script src="jquery.js" type="text/javascript"></script> </script><script type="text/javascript" src="js/jquery-1.9.1.js"></script> <script type="text/javascript"> $(document).ready(function(){ $('#rb1').change(function(){ var id=$('#municipio').val(); $('#datom').load('datosm2.php?id='+id); }); $('#rb2').change(function(){ var id=$('#municipio').val(); $('#datom').load('datosm.php?id='+id); }); $('#rb3').change(function(){ var id=$('#municipio').val(); $('#datom').load('datosm1.php?id='+id); }); });
Código HTML:
$valor=$_GET['id'];
if (!empty($valor)) {
$re = mysql_query("select codciu,gvotos from contacto where codciu='$valor'");
if ($fila = mysql_fetch_array($re)) {
?>
[COLOR="Red"]Habilita el boton[/COLOR]
<?php
}else{
?>
[COLOR="Red"]Deshabilita el boton[/COLOR]
<?php
}
}