Validating numbers
Hi, when i validate a textbox the numbers desapears.
And another thing, how can i give the focus to the next textbox (nombres)?
<script type="text/javascript">
function validar(e) {
tecla = (document.all)?e.keyCode:e.which;
if (tecla==8 || tecla==0){
return true;
}
patron = /([0-9\.])/;
te = String.fromCharCode(tecla);
}
</script>
<form action="" method="post" name="form1" id="form1">
<table width="291" border="1">
<tr>
<td width="108">Cedula</td>
<td width="10"> </td>
<td width="151"><label>
<input type="text" name="texCedula" id="texCedula" maxlenght="12" onKeyPress="return validar(event)"/>
</label></td>
</tr>
<tr>
<td>Nombres</td>
<td> </td>
<td><label>
<input type="text" name="texNombres" id="texNombres" />
</label></td>
</tr>
<tr>
<td>Apellidos</td>
<td> </td>
<td><label>
<input type="text" name="texApellidos" id="texApellidos" />
</label></td>
</tr>
<tr>
<td><label>
<input type="submit" name="butGuardar" id="butGuardar" value="Guardar" />
</label></td>
<td> </td>
<td><input type="button" name="butLimpiar" id="butLimpiar" value="Limpiar" /></td>
</tr>
</table>
</form>
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Bookmarks