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.

Drop Down options to provide response in a diffrent field

Avatar

Former Community Member
I have managed to create an interactive form with its various functions, however have a couple of areas not working out as preferred.



1. for example I have a Drop down field (Named "AREA1") with three options to select from, however depending on which one of the three options selected I requirer a diffrent text/descriptions showing in another text field (Named RC1) for each of the options from the drop down field. What script is required and in what field do I allocate the script?



2. I have three numeric column (Amount), (GST) and (Total). I have written scripts to the GST and total columns which automatically calculates the GST value and also the total of the original amount plus the GST. My problem is that in a user format or PDF preview the GST and Total Column is showing 0.00 and I would prefer these fields to not show anything until the amount column is populated. some kind of conditional formatting perhaps?



Some simple feedback to both of these would be greatly appreciated.



Ben
2 Replies

Avatar

Level 4
1. In the drop down list change event, use a switch statement e.g.



switch (this.rawValue)

{

case "Answer 1":

RC1.rawValue = "Whatever you want to say";

break;

case "Answer 2":

RC1.rawValue = "Whatever else you might want to say";

break;

default:

RC1.rawValue = "Default text";

break;

}



2. Don't know, not something I have explored yet but I would guess you could fiddle with making the numeric field hidden and an extra text field and an if statement e.g.



if (hiddenField.rawValue == 0)

{

visibleField.rawValue = "";

}

else

{

visibleField.rawValue = hiddenField.rawValue;

}



Hope this helps,



Tom

Avatar

Former Community Member
Thomas



Many thanks



I will try your recommendations



Regards and Merry Christmas



Ben