Ver Mensaje Individual
  #6 (permalink)  
Antiguo 01/06/2012, 10:25
Avatar de franfritz
franfritz
 
Fecha de Ingreso: marzo-2003
Ubicación: Stgo Chile
Mensajes: 260
Antigüedad: 21 años, 1 mes
Puntos: 0
Respuesta: jquery.validate required calendario

garciasanchezdani ocupé el focusout, pero no me funcionó.

quike88 estoy usando el datepicker de jquery.
Este es el código y tal como digo; no desaparece el mensaje al seleccionar una fecha.

Código:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head><title>
	Formulario
</title>
	<link href="css/estilo.css" rel="stylesheet" type="text/css" />
	<link href="css/custom-theme/jquery-ui-1.8.12.custom.css" rel="stylesheet" type="text/css" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
	<script type="text/javascript" src="js/jquery-1.5.2.js"></script>
	<script type="text/javascript" src="js/jquery-ui-1.8.12.custom.min.js"></script>
	<script type="text/javascript" src="js/jquery.json-2.2.js"></script>	
	<script type="text/javascript" src="js/jquery.validate.js"></script>
	

	
    <script type="text/javascript" language="javascript">

	
         $("#fec_nac").focusout(function(){  //el id de tu input fecha es campofecha
                  if( $(this).attr('value') != '' )
				          $('#form1').validate();
         });	
	
	$(function(){
		$( "#fec_nac" ).datepicker();
		$('#region').change(function(){
				if($(this).val()!=''){
					$('#form1').validate();
					$('#comuna1').hide();
					$('#comuna2').show();
					$('#comuna2').load('comuna.php?region='+$(this).val());  
				}	
		});
	})	
	
	$(document).ready(function(){
        $('#form1').validate();
	});	
    </script> 
	
    </head>
<body>
<form method="post" action="" id="form1" name="form1">

    <div class="page">
            
                <div id="header"></div>
            
        

    <div id="MainContent_PanelGeneral">
	

            <table border="1" style="width: 100%;" cellpadding="2" cellspacing="2" 
                class="bordes">
				<tr>
					<td rowspan="7" style="width: 60px">
						<img id="MainContent_Image1" src="img/1.png" />
                    </td>
					<td style="width: 300px">
                      <label for="rut">  R.U.T * </label>
					</td>
					<td>
					
					<input type="text" name="rut" id="rut" class="rut required" maxlength="10" style="width:150px;">
						
					</td>
				</tr>
				<tr>
					<td>
						Nombres *
					</td>
					<td>
						<input type="text" name="nombres" id="nombres" class="required" maxlength="50" style="width:250px;">
					</td>
				</tr>
				<tr>
					<td>Apellido Paterno *</td>
					<td>
						<input type="text" name="paterno" id="paterno" class="required" maxlength="50" style="width:250px;">
					</td>
				</tr>
				<tr>
					<td>Apellido Materno *</td>
					<td>
						<input type="text" name="materno" id="materno" class="required" maxlength="50" style="width:250px;">
					</td>
				</tr>
				<tr>
					<td>
						Fecha Nacimiento *</td>
					<td>
					<input type="text" name="fec_nac" id="fec_nac" class="required"/>
					</td>
				</tr>

			</table>
            <br />
            <table cellspacing="0" cellpadding="2" border="0" style="width: 100%">
                <tr>
                    <td colspan="3" style="text-align: right">
                        <input type="submit" value="Enviar Formulario" id="MainContent_btnGrabar" style="height:26px;" />
                    </td>
                </tr>
			</table>

	</div>
            

	</div>

</div>

    </div>
 </form>
</body>
</html>