Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

Remove everything after first commas (,) from string


Level 1

I have textfield1 and textfield2, I want to reduce characters after commas in textfield2


textfield1 =

This is mango, the color is green

in textfield2 =

this is mango

I want to use if with initialization / trigger "comma (,)"

If in php like this :

remove everything after first comma from string in php - Stack Overflow

How i write in adobe live cycle

please help if anyone understands in adobe live cycle

3 Replies


Level 10


In JavaScript you could use "textfield2.rawValue = "This is mango, the color is green".split(",")[0]"

Which turns your string into an array split on the comma and then you take the first one.


Level 1

I want to make it automatic with various kinds of long characters

When i write in textfield1 , so textfield2 automatic corection after comma will be remove

How do i write the code ? Do use ...If...Else ?


Level 10

I am not sure what you mean by "various kinds of long characters".  But for the example you have you could put the following line of JavaScript code in the calculate event of textfield2


This assumes that textfield2 and textfield1 are at the same level in the form structure as the textfield1 is a relative reference.