MetroToday
MIS
I have a search field where I want only Numeric values to be inputed.
Below is the code I added.
Sub btnSubmit_OnClick()
If Not IsNumeric(FrmBarcode.Bcode.value) Then
Alert "Only numeric values are accepted"
FrmBarcode.Bcode.Focus
Exit Sub
End If
End Sub
This all works fine, only problem is that the search still goes on for the value entered in the text box. I want to know a way to stop the page from going to the next page if the user enters a non-numeric value.
Below is my form code for the text box and submit button.
<form name=frmBarCode action="SearchResults.asp?UID=<%=Server.URLEncode(Request.QueryString("UID")%>" method=POST> Bar Code
<INPUT TYPE="Text" name="BCode" size = 10>
<INPUT TYPE=submit Value="Submit" name="btnSubmit">
</FORM>
Below is the code I added.
Sub btnSubmit_OnClick()
If Not IsNumeric(FrmBarcode.Bcode.value) Then
Alert "Only numeric values are accepted"
FrmBarcode.Bcode.Focus
Exit Sub
End If
End Sub
This all works fine, only problem is that the search still goes on for the value entered in the text box. I want to know a way to stop the page from going to the next page if the user enters a non-numeric value.
Below is my form code for the text box and submit button.
<form name=frmBarCode action="SearchResults.asp?UID=<%=Server.URLEncode(Request.QueryString("UID")%>" method=POST> Bar Code
<INPUT TYPE="Text" name="BCode" size = 10>
<INPUT TYPE=submit Value="Submit" name="btnSubmit">
</FORM>