简体   繁体   English

从Adobe LiveCycle中的字符串中删除第一个逗号(,)之后的所有内容

[英]Remove everything after first commas (,) from string In Adobe LiveCycle

I have textfield1 and textfield2, I want to reduce characters after commas in textfield2 我有textfield1和textfield2,我想在textfield2中减少逗号后的字符

example: 例:

textfield1 = textfield1 =

This is mango, the color is green 这是芒果,颜色是绿色

in textfield2 = 在textfield2 =

This is mango 这是芒果

I want to use if with initialization / trigger "comma (,)" 我想与初始化/触发器“逗号(,)”一起使用

If in php like this : 如果在PHP这样的:

remove everything after first comma from string in php 从PHP中的字符串中删除第一个逗号后的所有内容

please help if anyone understands in adobe live cycle 如果有人了解Adobe Live周期,请提供帮助

Maybe something like this should do on an exit event. 也许应该在退出事件上执行类似的操作。

var originalText      = textfield1.rawValue;
var placeOfFirstComma = originalText.indexOf(",");
var reducedText       = originalText.substring(0, placeOfFirstComma);
textfield2.rawValue   = reducedText; 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM