Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events

Dynamic spacing between two fields on runtime


Level 2

Hi all,

I want to provide space between two fields on runtime.

The current output looks like:

spacing between two fields dynamically adobe form.JPG

In the above output, there is a manual space put up in the layout of design view, but in actual i want to join both fields together without space and it should

display with spaces on runtime.

I have tried changing both fields layout to expand to fit along X and also tried it in flowed subform with western text, but nothing is working.

Please post your advice and inputs as soon as possible.



1 Reply


Level 7

Definitely too late for this i would think, but here is a nice solution.

I have a textfield with the default value "Amount: "

I also have a second textfield for the amount value. I used a textfield because a value of 1.00 in a numericfield will become just '1' in a text field when you move the raw value.

On the textField2 exit event i have this:

form1.#subform[0].TextField2::exit - (JavaScript, client)

TextField1.rawValue = TextField1.rawValue + TextField2.rawValue + " INR";
TextField2.presence = "hidden";

What will happen is that when TextField2 is exited, the textfield rawValue changes to itself, the TextField2 rawValue and the text "INR". TextField2 then disappears so all you are left with is one field with all the text as you want.

Two fields


TextField2 contains the Amount value you specify


When exiting TextField2, the text is all concatenated together.