Results 1 to 10 of 10

Thread: Check if Textbox input is numeric

Threaded View

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2004
    Location
    in the heart of the Mediterranean
    Posts
    1,143

    Check if Textbox input is numeric

    Hi ,

    I am trying to check for a numeric input. I had this procedure in windows app and Im trying to put it in web but Im getting an error on
    ctl.text in the code below

    any ideas how I can correct this pleased.. Many thanks


    VB Code:
    1. Private Sub Submit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Submit.Click
    2.         Dim bLoop As Boolean = True
    3.         Do While bLoop = True
    4.             bLoop = False
    5.             Dim ctl As Control
    6.             For Each ctl In Me.Controls   'checks to see if all required textboxes have been completed
    7.                 If [B]Trim([COLOR=RoyalBlue]ctl.Text[/COLOR]) [/B] = "" And TypeOf ctl Is TextBox Then
    8.                      Msgbox("Please make entry for " & ctl.ID.ToString)
    9.                     bLoop = True
    10.                 End If
    11.             Next
    12.             Select Case False    'check for numeric entry
    13.                 Case CheckNumeric(txtmobile.Text)
    14.                     txtmobile.Text = Not (IsNumeric("Mobile"))
    15.                     bLoop = True
    16.                 Case CheckNumeric(HomeTel.Text)
    17.                     HomeTel.Text = Not (IsNumeric("HomeTel"))
    18.                     bLoop = True
    19.             End Select
    20.         Loop
    Last edited by angelica; Oct 6th, 2005 at 05:27 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width