Form validation issue the Space Character

Results 1 to 2 of 2

Thread: Form validation issue the Space Character

  1. #1
    ActiveALLI Guest

    Default Form validation issue the Space Character

    I need to find out how to not alow users to insert a space in a form field. can anybody tell me how that would be done with Serverside VBScript. since i have all of the Form validation in ServerSide VBscript i&#039d perfer not to have this one with client side javascript and a alert.<BR>

  2. #2
    Ben Timby Guest

    Default RE: Form validation issue the Space Character

    You could use the InStr() function to check the form value like this:<BR><BR>If InStr(Request("FieldName"), " ") Then <BR>Blah, Blah, Blah<BR>End If<BR><BR>InStr() will return an integer that represents where the " " character appears in the string Request("FieldName"). If it does not exist, it will return 0 (False) Otherwise, it will be a positive non-zero value (True). HTH.

Posting Permissions

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