Sign in to follow this  
Followers 0
IvanCodin

Input box characters alpha only

3 posts in this topic

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

Thanks! I was looking at the Help file but did see this.

Me

Share this post


Link to post
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
Sign in to follow this  
Followers 0