Expand my Community achievements bar.

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

If user enters 1st or 2nd field, user must to enter on 3rd as well

Avatar

Level 8

Hello

I have to throw error message (app.alert) if user crosses(comes down) from a horizontal line (its not a object, its just in my mind, say, its imaginary line on the form), pls. let me know how can achiive this?

Actually, i have 6 fields in my_subform, among these 6, the 3 fields are cros--dependednt (i mean, if user enters data on 1st or 2nd....then, user must to enter on 3rd field as well, else erorr.....so, with out entering on the 3rd user should not do any other stuff)

It worked for me when i put JS on EXIT event of subform level, but, i dont want that, bcz subform is very big in size, occupies whole page

By scroll down / scroll up action? if so, how can i capture the scroll up/down actions of the user?

i guess, mouseDown event is some thing else

Thank you

5 Replies

Avatar

Level 10

Hi,

would use a script on the exit event of the 3rd field which checks the previous two fields and refocus on the 3rd field as long it also has been filled.

if (!Textfield1.isNull && !Textfield2.isNull && this.isNull) {

          xfa.host.setFocus(this.somExpression);

}

Avatar

Level 8

Thank you.

But, if user NOT AT ALL clicks (or put cursor or even move the cursor around 3rd field, directly jumps to next page from 1st field by scrolling) 3rd field....in that case also, this EXIT of 3rd field triggers? now, our system is donw i can not test it

Pls. let me know

Avatar

Level 10

Ok,

in addition to my previous suggestion you can use the setFocus method to guide the users into Textfield3.

1. In the exit event of Textfield1 check the value of Textfield2. If not empty, jump into Textfield3.

if (!Textfield2.isNull) {

          xfa.host.setFocus(Textfield3.somExpression);

} else {

          xfa.host.setFocus(Textfield2.somExpression);

}

2. In the exit event of Textfield2 check the value of Textfield1. If not empty jump into Textfield3.

if (!Textfield1.isNull) {

          xfa.host.setFocus(Textfield3.somExpression);

}

3. In the exit event of Textfield3 check the value of the previous Textfields. If not empty, refocus into Textfield3 until it also has a value. The users won't be able to set focus on any other field by tab button or mouse.

if (!Textfield1.isNull || !Textfield2.isNull) {

          if (this.isNull) {

                    xfa.host.setFocus(this.somExpression);

          }

}

4. To ensure the focus alsway begins at Textfield1 use this script in the docRead event of your form.

xfa.host.setFocus(Textfield1.somExpression);