Jump to content
Sign in to follow this  
Phenom

how to check if an input box is empty

Recommended Posts

Phenom

if $input1 == "" doesn't work.

Share this post


Link to post
Share on other sites
XRS

Try to use if $input1 = '' , if $input1 = ' ' or if $input1 = " " .

Maybe one of them will work :mellow:

Share this post


Link to post
Share on other sites
XRS

But if we use that if it will wont check if the inputbox have the value 0 ?

Share this post


Link to post
Share on other sites
zorphnog

First of all, are you talking about an InputBox or a GuiCtrlCreateInput? If you are using InputBox, $input1 == "" will work. If you are using the GuiCtrlCreateInput method you will need to use GuiCtrlRead($input1) to get the contents of the input box.

In the future, provide as much detail as possible. Saying that something doesn't work does not really give us much information. Always provide the code you have tried so that we can assess the problem.

Share this post


Link to post
Share on other sites
Phenom

Yeah, I was talking about the inputbox for the gui, GuiCtrlCreateInput.

Share this post


Link to post
Share on other sites
99ojo

Hi,

as Zorphnog suggests:

$input1 = GuiCtrlCreateInput.......

If GuiCtrlRead($input1) = "" Then MsgBox (0,"Empty.....", "....Input detected!")

;-))

Stefan

Edited by 99ojo

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.