Un saludos a todos, mi problema es el siguiente, tengo una aplicacion php, donde tengo algunos form llamados a un contenedor usando ajax, lo que quiero es que el form se quede en pantalla luego de validar y enviar la informacion, para cargar de nuevo el mismo con informacion nueva.., tengo unas funciones que validan un campo especifico del form q no debe estar vacio, bueno gracias de ante mano..
aqui mi codigo de validacion:
function valida(formulario) {
if( vacio(formulario.campo.value) == false ) {
alert("Introduzca numero de paciente");
document.formulario.campo.focus();
return false
} else {
alert("Datos guardados")
/
document.formulario.focus();
return true
}
}
este mi form:
<form name="formulario" method="get" action= "" onSubmit="return valida(this);">
<table width="511">
<tr>
<td width="63" align="right"><span class="Estilo14">Nombre:</span></td>
<td width="167" align="left"><input name="nom_pac" type="text" id="nom_pac" onkeypress="return validar(event)" /></td>
<td width="88" align="right" valign="middle">Área:</td>
<td width="150" align="left"><span class="Estilo7">
<input name="area_pac" type="text" id="area_pac" />
</span></td>
</tr>
<tr>
<td align="right"><span class="Estilo14">Apellido:</span></td>
<td align="left"><span class="Estilo7">
<input name="ape_pac" type="text" id="ape_pac" />
</span></td>
<td align="right" valign="middle"><span class="Estilo14">Condición</span><span class="Estilo12">: </span></td>
<td align="left"><span class="Estilo7">
<input name="condi_pac" type="text" id="condi_pac" />
</span></td>
</tr>
<tr>
<td align="right"><span class="Estilo14">Cedula: </span></td>
<td align="left"><span class="Estilo7">
<input name="ced_pac" type="text" id="ced_pac" />
</span></td>
<td align="right" valign="middle">Nº:</td>
<td align="left"><span class="Estilo7">
<input name="campo" type="text" id="campo" size="3" maxlength="12" onkeypress="return validar1(event)"/>
</span></td>
</tr>
<tr>
<td align="right">Fecha:</td>
<td align="left" valign="top"><form method="post" name="form1" id="form1" action="">
<div align="left">
<input name="nombre_de_la_caja" type="text" id="campo_fecha" size="14" />
<input name="button" type="button" id="dateArrival" onclick="popUpCalendar(this, form1.campo_fecha,'mm-dd-yyyy');" value="..." size="10" />
</div>
</form></td>
<td align="right" valign="middle">Edad:</td>
<td align="left"><span class="Estilo7">
<input name="edad_pac" type="text" id="edad_pac" size="3" maxlength="12" onkeypress="return validar(event)"/>
</span></td>
</tr>
<tr>
<td align="right">Sexo:</td>
<td align="left" valign="middle"><label>
<select name="sexo_pac" id="sexo_pac">
<option>Masculino</option>
<option>Femenino</option>
</select>
</label></td>
<td align="right" valign="middle"> </td>
<td align="left"> </td>
</tr>
<tr>
<td align="right"> </td>
<td align="left" valign="middle"> </td>
<td align="right" valign="middle"><input name="regpaciente2" type="submit" class="boton" id="regpaciente2" value="Ingresar" /></td>
<td align="center"><input name="regpaciente" type="reset" class="boton" id="regpaciente" value="Borrar" /></td>
</table>
</form>