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.

Scripting Help

Avatar

Former Community Member

I created a form in Adobe Live Cycle and need helping on scripting.  I have a field as Drop Down list as Sample one, Sample two, Sample three , Sample four, and Sample five in that field.  I would like to have another field with 1, 2, 3, 4, and 5. Every time a user selects Sample One in the first field, the second field would auto-fill a numeric of 1.  If the user selects, Sample Two in the first field, the second field would automatically enter as 2, and so on. 

Is it possible to create a scripting for this? Some type of form calculation? 

Any help is appreciated.

1 Reply

Avatar

Level 6

//check the following JavaScript in change event of DD1.....

// form1.#subform[0].DD1::change - (JavaScript, client)

if (xfa.event.newText == "Sample 1") {
DD2.rawValue = "1";
}
if (xfa.event.newText == "Sample 2") {
DD2.rawValue = "2";
}
if (xfa.event.newText == "Sample 3") {
DD2.rawValue = "3";
}