Jump to content
Fórum Script Brasil
  • 0
Sign in to follow this  
fantasma

Validação

Question

tenho uma caixa de texto e quero que tudo digitado nesta caixa seja apenas texto

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

HEHE DE UMA adaptada no seu codigo para funcionar .

<html>

<head>

<script language="JavaScript">

function teste(e) {

if(window.event) {

// for IE, e.keyCode or window.event.keyCode can be used

key = e.keyCode;

}

else if(e.which) {

// netscape

key = e.which;

}

if (key!=8 || key < 48 || key > 57) return (((key > 47) && (key < 58)) || (key==8));

{

    return true;

  }

}

</script>

</head>

<body>

<form>

<input type='text' class='textbox' name='ie' maxlength='8' onKeypress="return teste(event);">

</form>

</body>

</html>

Share this post


Link to post
Share on other sites
  • 0

muito legal, mas eu quero que so entra letra e não numeros

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  



  • Forum Statistics

    • Total Topics
      148558
    • Total Posts
      644318
×
×
  • Create New...