Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

Using FormCalc to automatically replace text in a text field?

Avatar

Former Community Member
Hi,



I'm trying to use FormCalc to automatically look for a string and replace it in a text field. I'm trying to do this by setting the script of the "Change" event in the text field to this:



$=Replace($, "address__", "123 Fake Street\u000aAnycity, NT 12345")



So thus, when a user types "address__" into the text field, it replaces the string "address__" with the actual address. I would create one line of code for each different address that I wanted to use.



What am I doing wrong, syntax-wise? I don't get any script errors, it just doesn't do anything.



I know very little about using FormCalc - are there any good tutorials out there on the internet? Most LiveCycle Designer documentation seems to be geared towards JavaScript users, but FormCalc seems fine for my needs.



Thanks.
1 Reply

Avatar

Level 5
Script works good if you can use in 'exit' event. Also it is good to use $.rawValue = Replace($.rawValue, "address__", "123 Fake Street\u000aAnycity, NT 12345")



Good Luck,

SekharN

www.lawson.com