Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Chcek for blank textfields without submit button

Avatar

Level 9

I need to validate that the user has populated the top section of the form (about 15 textfields). Is there a way that when the suer enters a textfield about midway down the form (a field they will absolutely have to populate) that the others above it can be checked to be sure they were not left blank?

1 Accepted Solution

Avatar

Correct answer by
Level 7

You could put something like this into the enter event of the textfield you want to trigger the check (in Formcalc and assuming you have named all the fields above TextField1):

var nullCheck = 0

while (nullCheck <= 15) do

if (TextField1[nullCheck].isNull) then

    xfa.host.messageBox("You cannot leave a field blank")

    break

endif

nullCheck = nullCheck + 1

endwhile

View solution in original post

2 Replies

Avatar

Correct answer by
Level 7

You could put something like this into the enter event of the textfield you want to trigger the check (in Formcalc and assuming you have named all the fields above TextField1):

var nullCheck = 0

while (nullCheck <= 15) do

if (TextField1[nullCheck].isNull) then

    xfa.host.messageBox("You cannot leave a field blank")

    break

endif

nullCheck = nullCheck + 1

endwhile