Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. textbox validation very urgent

textbox validation very urgent

Scheduled Pinned Locked Moved C#
helptutorialquestion
6 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vijayashanthi
    wrote on last edited by
    #1

    hi! i want to create the following textboxes.. please help me.. 1.one textbox contains numeric values only. 2.one contains characters only. 3.one contains EmailId. 4.one contains phone no 5.one contains pincode. 6.one contains fax no. 7. one contains mobile no. 8. one contains fax no. how to validate this?

    S S F 3 Replies Last reply
    0
    • V vijayashanthi

      hi! i want to create the following textboxes.. please help me.. 1.one textbox contains numeric values only. 2.one contains characters only. 3.one contains EmailId. 4.one contains phone no 5.one contains pincode. 6.one contains fax no. 7. one contains mobile no. 8. one contains fax no. how to validate this?

      S Offline
      S Offline
      sam
      wrote on last edited by
      #2

      use pattern matching for this.if you want to validate your input at the time of keypress then you have to do a little extra work on textBox_KeyPress event else apply your validation at the time when you control looses its focus

      1 Reply Last reply
      0
      • V vijayashanthi

        hi! i want to create the following textboxes.. please help me.. 1.one textbox contains numeric values only. 2.one contains characters only. 3.one contains EmailId. 4.one contains phone no 5.one contains pincode. 6.one contains fax no. 7. one contains mobile no. 8. one contains fax no. how to validate this?

        S Offline
        S Offline
        sharmit
        wrote on last edited by
        #3

        Check if this helps u, Following code snippet is an example for validation of textbox. similar way compare values with different ascii numbers i.e. for only characters, numeric values...etc.. //VALIDATION FOR TELEPHONE NUMBER bool valid5 = false; char[] name5=new char[20]; name5=textBox27.Text.ToCharArray(); int leng5=textBox27.Text.Length ; for(int i=0 ; i < leng5 ; i++ ) { if( ((Convert.ToInt32(name5[i])>='0')&&(Convert.ToInt32(name5[i])<='9'))||(Convert.ToInt32(name21[i])==32)) { valid5=true; } else { MessageBox.Show("TELEPHONE NUMBER: Enter the valid Telephone Number"); textBox27.Focus(); return; } }

        1 Reply Last reply
        0
        • V vijayashanthi

          hi! i want to create the following textboxes.. please help me.. 1.one textbox contains numeric values only. 2.one contains characters only. 3.one contains EmailId. 4.one contains phone no 5.one contains pincode. 6.one contains fax no. 7. one contains mobile no. 8. one contains fax no. how to validate this?

          F Offline
          F Offline
          Frank Kerrigan
          wrote on last edited by
          #4

          Use a Validator with regular expression. there are lots of examples on the web.

          Grady Booch: I told Google to their face...what you need is some serious adult supervision. (2007 Turing lecture) http:\\www.frankkerrigan.com

          S 1 Reply Last reply
          0
          • F Frank Kerrigan

            Use a Validator with regular expression. there are lots of examples on the web.

            Grady Booch: I told Google to their face...what you need is some serious adult supervision. (2007 Turing lecture) http:\\www.frankkerrigan.com

            S Offline
            S Offline
            SandeepN
            wrote on last edited by
            #5

            I would like to check if user has entered ALT+10 or à , ä (UMALUT) or any english alphabets The code sample in previous thread by 'sharmit' did not work for me. Can you please point me the websites where I can find code sample for the same.

            Sandeep Naik

            S 1 Reply Last reply
            0
            • S SandeepN

              I would like to check if user has entered ALT+10 or à , ä (UMALUT) or any english alphabets The code sample in previous thread by 'sharmit' did not work for me. Can you please point me the websites where I can find code sample for the same.

              Sandeep Naik

              S Offline
              S Offline
              SandeepN
              wrote on last edited by
              #6

              I want to basically check if user has entered any control characters like 1-32 or 127 ASCII value (Ex: ALT + 127) in the edit box. And discard the same. FYI this edit box should allow any other non english characters like French, German, Chinese, Japanese etc

              Sandeep Naik

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups