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.
SOLVED

Blank Spaces leading the text field

Avatar

Level 2

Hey guys ,

I have 5 text fields vertically one over the other in the layout name,address, street , street2 , post code . I have binded the text fields with an internal table(SAP) that populates the data on to the text field. Among the five two fields street 2 and post code works fine without any space leading them but the other three fields are having a blank space leading them i.e. blank space and name/address/street gets printed. How to remove the blank spaces using javascript or formcalc and which event is to be used ?

Please help me out.

1 Accepted Solution

Avatar

Correct answer by
Level 2

Issue is solved , added formcalc script to those fields

Event : Calculated

var c = data.Main.Address.Name.rawValue

$.rawValue = ltrim(c)

But still could not find where the spaces came from

View solution in original post

7 Replies

Avatar

Level 10

Hi,  Are you wanting to remove blank spaces from the data coming from the SAP system or remove the left indent on the field in the Paragraph palette?

Could you include a screen shot of the problem?

Avatar

Level 2

I don't know where's the problem , tried removing the leading spaces in SAP coding but still i'm getting spacesasda.png

You can see in the image first three fields have space leading them , there is no left indent for those fields.

Avatar

Level 10

So is this a text field with floating fields in it?  Is it possible for you to share your form (or a simple form showing the problem) and add a link to it here.

Avatar

Level 2

This is a text field only not floating field, sorry i can't share the form

Avatar

Level 10

That makes it difficult to investigate, but I would be surprised if it was a product fault, maybe delete the fields and add then in again.

Avatar

Level 2

Tried that , also used text and floating field binded the name to it same result. Dont know where the problem is

Avatar

Correct answer by
Level 2

Issue is solved , added formcalc script to those fields

Event : Calculated

var c = data.Main.Address.Name.rawValue

$.rawValue = ltrim(c)

But still could not find where the spaces came from