Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Code is not working

Avatar

Level 4

Hi All,

I have the following code under the calculate event but the first part that deals with the text "Exceed" is not working. I cannot figure out why, because, it did work thefirst time I wrote it, but has just stopped working. Please can someone out on the forum take a look at it and see what is wrong. See code below:

if (Page5.raterec1.rawValue >= 5 && Page5.raterec1.rawValue < 7)

{

     Page5.dolamt1.rawValue= "Exceed"

     Page1.rrout1.rawValue = 1;

}

else

{

Page5.dolamt1.rawValue = "";

Page1.rrout1.rawValue =0;

}

Thanks

lucp

3 Replies

Avatar

Level 10

Hi,

If it was working and now is not, then I suspect that the object has been renamed OR the object is not is a subform, so that the relative reference is no longer correct.

Check the hierarchy to see the path from the object with the script to the dolamt1 object.

Is dolamt1 a textfield?

There should be a semi-colon after exceeds:  ... = "Exceed";

Does that help?

Niall

Avatar

Level 4

Thank you, but that did not help, because, there three diff

erent check boxes, and depending on the values, it will put

Exceed, Met, or not met in the textfield dolamt1. If start with the code in the first check box it will work, but as soon as move to the second and third check boxes, the textfield will only work for one, passing the equivalent value of met from the second check box to the textfield, but will not work with the first, and  third check boxes. If I use three different textfields for each value it works perfect. However, IT SHOULD BE JUST ONE TEXTFIELD that should be receiving this values of either Exceed, Met or Not Met.

Thanks, again

v/r

Lucp

Avatar

Level 10

Okay,

You can get this to work for multiple fields reporting back to a single textfield, but the script will need to be expanded to look at all three checkboxes.

It would be easier if I could see the form. Can you share it?

If you can upload it to a file sharing site, like Acrobat.com, publish it and then share the link here.

Niall