dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: Validating numbers

  1. #1
    Join Date
    Jun 2012
    Posts
    3

    Wink 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">&nbsp;</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>&nbsp;</td>
    <td><label>
    <input type="text" name="texNombres" id="texNombres" />
    </label></td>
    </tr>
    <tr>
    <td>Apellidos</td>
    <td>&nbsp;</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>&nbsp;</td>
    <td><input type="button" name="butLimpiar" id="butLimpiar" value="Limpiar" /></td>
    </tr>
    </table>

    </form>

  2. #2
    Join Date
    Jun 2012
    Posts
    3

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
  •  
HTML5 Development Center



Recent Articles