
check input field, only numbers accepted
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
<Script language="VBScript">
function CheckText()
If isNumeric(mytext.value) Then
'submit the form write the cookie etc...
Else
MsgBox "You must enter a number!"
End IF
End function
</script>
</HEAD>
<BODY>
<input type="text" Name="mytext">
<input type="button" Onclick="CheckText()" Value="Go!">
</BODY>
</HTML>
Bryan Martin
: Hi,
:
: I have a input field, where only numbers (no letters or other signs)
: will be accepted. When confirming the button, the asp-page will be
: reloaded, the field value will be saved into a cookie and will be shown
: on the screen.
: My problem is now, that I only want to accept numbers. How can I check
: it? When a letter is written and confirmed, a default value shall be
: saved into the cookie, instead of the letter.
:
: Thanks for your help.
:
: Daniel
: