Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Input Mask #AAA##

Status
Not open for further replies.

endoflux

Technical User
Aug 6, 2001
227
US
This may be more of an HTML question, but it's for a database function, and I hve a feeling I'll find my answer more quickly here:

I want to limit entry on this code to an entry of #AAA## where # is Numeric and A is Alpha, and either notify the user real-time that the format is wrong, or just have invalid characters not register. What would be the easiest way to accomplish this?

<input type="text" name="RecNum" size=6 maxlength="6">

Thanks!
 
ok as i have some free time now...here is the complete function...

Code:
Function InputMask(input)
  Dim re
  Set re = new RegExp

  re.IgnoreCase = false
  re.global = false
  re.Pattern = "^[0-9][A-Z][A-Z][A-Z][0-9][0-9]$"

  InputMask = re.Test(input)
End Function

just call the function with the input as the text of your input text box...

-DNG
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top