Jump to content
Sign in to follow this  
dash007

Setting minimum limit to Input box

Recommended Posts

dash007

Guys,

I use a GUI inputbox and the script GUICtrlSetLimit($input, 12, 2)

This restricts maximum entry to 12 but somehow the minimum does not seem to work (in the above example it should be 2). Any advice.

Also is there a script to check if the field is blank. Thanks in adv

Share this post


Link to post
Share on other sites
BigDaddyO

To Check if it's blank you will have to use something like

if StringLen($InputBoxID) = 0 then msgbox(0, "Blank", "Hay Stupid type something").

for the minimimum I would guess something simmilar.

If StringLen($InputBoxID) < 2 Then msgbox(0, "Less then 2", "You must have at least 2")

Edit: Forgot you have to read the inputbox to get the text.

$InputBoxID = GUICtrlRead($InputBox1)

Edited by MikeOsdx

Share this post


Link to post
Share on other sites
dash007

To Check if it's blank you will have to use something like

if StringLen($InputBoxID) = 0 then msgbox(0, "Blank", "Hay Stupid type something").

for the minimimum I would guess something simmilar. 

If StringLen($InputBoxID) < 2 Then msgbox(0, "Less then 2", "You must have at least 2")

Edit:  Forgot you have to read the inputbox to get the text.

$InputBoxID = GUICtrlRead($InputBox1)

<{POST_SNAPBACK}>

MikeOsdx, thanks for your help, I will try it tonight.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.