COUNT EMPTY TEXTBOXES

Hi!
I would like to create a count that counts the amount of empty textboxes.
For example, suppose we have $w(textbox1).text, $w(textbox2).text and $w(textbox3).text.
If 2 of them are blank, I would like my count to return 2.
I tried using Ifs but this became too long as in total I want to check 10 textboxes.
I’ve was going to try a loop but did not know how to do this for this scenario.

I am sure this is straightforward for someone who is better at coding.
Thanks!

It may also help to know, that the textboxes are in a sequence such that once one is blank, then the rest will be blank.
For example, suppose textbox4 is blank, so too are textboxes 5-10.

Hey Eaton,

You can get all the textboxes on the page using $w(“TextBox”) (or TextInput if that’s what you have on your pages). Then you can loop through all those elements using standard JavaScript and check their .text values.

Thanks, I have managed to do it!