Código:
<script type="text/javascript"> function rut(){ var rut1 = document.getElementById("rut").value; var rut2 = document.getElementById("rut2").value; var cv1 = document.getElementById("cv").value; var cv2 = document.getElementById("cv2").value; if((rut1!=rut2)&&(cv1!=cv2)){alert('Comprobar RUT');} </script>
Código:
<form id="cliente" name="cliente" method="post" action="crearCliente.php"> <table width="95%" border="0" align="center" cellpadding="1" cellspacing="1"> <tr> <td>Rut:</td> <td><input name="rut" type="text" id="rut" maxlength="8" value="" /> - <input name="cv" type="text" id="cv" size="1" maxlength="1" value="" /></td> <td>Reingresar Rut</td> <td><input name="rut2" type="text" id="rut2" maxlength="8" value=""/> - <input name="cv2" type="text" id="cv2" size="1" maxlength="1" value="" onblur="rut()"/></td> </tr> </table> </form>