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 menu validates value in field

Avatar

Level 1

I need some help with coding of this $ field. I've been learning formcalc as I go but have no javascript knowledge. Any suggestions would be greatly appreciated. when user selects from the dropdown menu what they select = a numaric value in another field.

Thanks for your help.

5 Replies

Avatar

Former Community Member

I don't know what you are asking. A common trip up with the change event though is that you need to use xfa.event.newText to get the new value since rawValue doesn't change until after the event is over.

Avatar

Level 1

I have a field with 3 dropdown items in it. I need a price field to populate with the correct price for each item. where do I start coding this?

Avatar

Former Community Member

You can put it in the change event of the drop down

Something like this JavaScript:

priceField.rawValue = xfa.event.newText;

or the calculate event of the text field

Avatar

Level 3

One simple solution I have used is to use Action Builder. You can open that up by right clicking on the drop down field and selecting Add Action. Then you create an action such as:

Condition

When Dropdown field 1 is Text Selected Value 1

Result

Set the value of a field [your chosen numeric field] to be [whatever value you desire]

Avatar

Level 1

Thank you so much! I've not seen any tutorials on using Action Builder. It worked great.

I hope it's capable of doing everything I need on these forms I've been thrown at.