Jump to content

Recommended Posts

@all

how can i command the InputBox() accept only A to Z no numbers?

and how can i do accept only one Character at a time? :ph34r:

-=[serialzs]=-

I believe I have seen a isalpha function in the help file

Check it out

Rick

Only $2.00 with Resale Rights How to Block Better for Martial Artists and NonMartial Artistshttp://kirkhamsebooks.com/MartialArts/Bloc...tterEbook_m.htm

Link to post
Share on other sites

You can use a couple of undocumented features of the password field of the InputBox to do some of this. I have to get around to updating those docs. :ph34r:

Use a space as the first character of the password. This way you can still see the characters that you type.

The second character can be an M to indicate that input is Manditory; you must enter something. Nothing will happen if you press Ok when there is nothing in the inputbox. It will not close and return the value.

You can also add the length of the string to be accepted. It will stop accepting characters when that number have been entered.

For example:

$x=InputBox("Title", "Prompt", "", " M2")

This will require input (no empty strings accepted) and have a maximum length of 2.

$pwd = InputBox("Login", "Enter your 6 character password.", "", "*6")

This will display stars (*) for each character entered, but will let you press Ok with a blank inputbox, but you can enter no more than 6 characters.

As for checking if the input is a alphabetic character, use StringIsAlpha to test.

Do
    $x = InputBox("Testing", "Prompt", " M1")
Until StringIsAlpha($x)

Edit: Fix typos.

Edited by Nutster

David Nuttall
Nuttall Computer Consulting

An Aquarius born during the Age of Aquarius

AutoIt allows me to re-invent the wheel so much faster.

I'm off to write a wizard, a wonderful wizard of odd...

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...