var field1 = IWDatacapture.getItem("/pathtofield/vfename").getValue(); // will set the value of field1 to be the datacapture field you specifyvar length = field1.length; //will get you the length of the stringIWDatacapture.getItem("/pathtofield/vfename").setValue(field1.replace(/test/g, "done")); // will change the current value with the new value that's replaced all word test with the word done
How to check the length of Visual Format Edidor fields and search/replace patterns. We are using form API[js] for imposing validations on content
<>
var x = y.replace(/\\s*,\\s*/g, ",");