+ Reply to Thread
Results 1 to 4 of 4

Validation Of Textboxes In A Form

  1. #1
    Registered User
    Join Date
    02-06-2007
    Posts
    7

    Validation Of Textboxes In A Form

    Hey, im looking to have some data validation on the 3 text boxes of my form.
    Text box 1 is Item name and i wish for that text box to only accept Text up to 30 characters.
    Text box 3 is Product code and i wish for it to only accept 10 chracters max, the first two of which must be text and the last ones must be number. eg CA04124 or EK123456, there must be at least 2 numbers after the first two letters but no more than 6, there must be two letters before the numbers also.
    Text box 4 is Price which i want to only accept number.

    I understand the text box numbering isnt even, i dont know why not. Here is the code i am working with. Is the only way for this validation to be done by editting the code? If so i would be very grateful for someone to do this for me or tell me how to.

    Please Login or Register  to view this content.
    Many thanks, Ben.

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    Use the MaxLength property to set the maximum length allowed in each text box


    This code checks for required info before adding to the sheet.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    02-06-2007
    Posts
    7
    Thanks mudraker, that codes works great.
    Could you show me the code that would validate TextBox1 (Item name) so that something written in there is less than 50 characters but more than 0. Thanks a lot, a quick reply would be much appreciated.

    Thanks, Ben.

  4. #4
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    Ben

    If you use the MaxLength property set to 50 then you cane use

    Please Login or Register  to view this content.
    Otherwise use this one

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1