Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

What event to use

Avatar

Level 7

I have a field that calculates a total. I'd like for the total if it's less than or equal to 250.00 to make a subform visible. The end user does not put their cursor in or leave the total field. What event should I use for my script?

Here's the script:

if (this.rawValue <= 250.00) {

    page1.superVisor.presence = "visible";

}

else {

    page1.superVisor.presence = "hidden";

}

Thanks,

MDawn

1 Accepted Solution

Avatar

Correct answer by
Level 9

Even if the user does not pue cursor or clicks in the TotalField, still you can use it's exit event. Put the above script in the exit event of the Total Field, then call the xit event, anywehere you want. Like. TotalField.execEvent("exit").

Thanks,

Bibhu.

View solution in original post

5 Replies

Avatar

Level 9

Hi ,

Try using calculate event. It will work.

Thanks,

Bibhu.

Avatar

Level 7

I already have a FormCalc script in the calculate event to provide the total for the field.

I wasn't sure how to add the JavaScript to that event.

Thanks,

MDawn

Avatar

Level 9

In the script editor language dropdown you can change that to JavaScript. But why are you trying to complicate things overe here? What's the actual issue here?

Thanks,

Bibhu.

Avatar

Level 7

This is a total field for a column of numbers. I'm using a FormCalc script in the Calculate event to provide the total in the field. It works fine.

Now I need to make a signature field visible if the total amount in the field is <- $250. I have a JavaScript that will make a subform visible.

I can't use the click or change events because the user does not put their cursor in or enter anything in the Total field.

I tried putting the JavaScript in the Validate event but it validates too many times than needed. That's why I posted originally.

Hope this helps.

Thanks,

MDawn

Avatar

Correct answer by
Level 9

Even if the user does not pue cursor or clicks in the TotalField, still you can use it's exit event. Put the above script in the exit event of the Total Field, then call the xit event, anywehere you want. Like. TotalField.execEvent("exit").

Thanks,

Bibhu.