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.
SOLVED

Script not working correctly

Avatar

Level 3

I am not new to Livecycle Designer but I am trying my hand at learning JavaScript programming so that I can utilize it in my forms to make them more robust and powerful.  I have been practicing and I now have one that has me stumped.  I am able to populate the drop down, but I can't get the description or the price field to populate.  Could someone help me understand what I am doing wrong in getting the description and price fields not working (The description and price fields will not populate)?  The data is nothing more than a array of senseless info, but the senseless data does match in numbers

Thanks for any help.  The link to my file is http://tinyurl.com/j4x9muh

1 Accepted Solution

Avatar

Correct answer by
Level 3
3 Replies

Avatar

Level 3

HI Mile,

You did a very small mistake. Instead of looping through the array items you were trying to loop through the single variable. So that case in real does not exists.

See below image for answer.ANSWER.png

Regards

Arvind

Avatar

Correct answer by
Level 3

Capture.PNG

Avatar

Level 3

Thanks Arvind .  I tried it the way you suggested, but it did not work.  I looked at the code again and noticed that my variable 'partNo' and the Function call 'whSize' were switched backwards... So instead of...

      if (partNo[i] == whSize)    which is what I needed... and changed to

and

      if(whSize[i] == partNo)    what I had originally

once I changed to the top one, it worked like a charm.  I didn't know that this would make a difference

Your examples caused me to think outside the box and give consideration for this change.

Thanks for your help and I look forward to your assistance in the near future

If you want, you can check out the corrections I made to the code at http://tinyurl.com/jzvl59u

Happy holidays Arvind!!

Mike