Jump to content

Setting minimum limit to Input box


dash007
 Share

Recommended Posts

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.
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...