AEM Adaptive Form Calculate Expression Script
How can I assign the value of a field based on the value of another field. For example if TextField1.value == 1 then this.value = 2.
How can I assign the value of a field based on the value of another field. For example if TextField1.value == 1 then this.value = 2.
This can be achieved by writing an expression like this.value = (TextField1.value ==1) * 2 . However if your case is so complex that you cannot derive an expression relating the fields then you can write a service, make an ajax call to it passing the value of TextField1, and return desired value of the field via service and assign the responseText of the field to the value in the calculate expression like
this.value = $.ajax (url: "service_end_point"
data: {valueOfTextField: TextField1.value}
).responseText
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.