If statement if which triggers if the input is not unidentified

Hello everyone,

I added an if statement to the code, and I want it to trigger if the user input is not unidentified.
The code is the following:
if ((value1 !== undefined) && (value2 !== undefined) && (value3 !== undefined) && (value4 !== undefined) && (value !== undefined))

The code is working great for text inputs but it does not work for an upload button.

How can I write an if statement that works only if the user did not add any file in an upload button (namely, when the user input to an upload button is undefined)?

Thank you very much in advance,
Tal

You should use .valid :

if($w("#input1").valid && $w("#input2").valid && $w("#uploadButton").valid) {
//do whatever you want
}

but first make sure that these user inputs are set to be “Required”.

Thank you!