Jump to content

Input box characters alpha only


Recommended Posts

Is ther any way in an input box to limit the characters that can be input.

Do

$strName = InputBox("Input","Enter all or part of a company name to search for:",""," M")

Until $strName <> ""

; MsgBox(0,"Info", "You entered " & $strname, 8)

I want the user to input characters only.

Me

Link to comment
Share on other sites

Assuming by "characters only" you mean, Letters a-z and A-Z.

Do
$strName = InputBox("Input","Enter all or part of a company name to search for:",""," M")
Until StringRegExp($strName,"^[a-zA-Z]+$")

If you want 0-9 as well, just change [a-zA-Z] to [a-zA-Z0-9] etc.

Edited by covaks
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...