Copy link to clipboard
Copied
Hi all,
Am wondering if it is possible (with JavaScript?) to extract specific text or text/numeric value from a separate field that a user has entered a value? e.g. - If "Text1" has a user entered value of "joe bloggs 2021", is it possible in "Text2" field, to extract only the "2021" value from the user entered text string, and populate that value (i.e. "2021") in to the "Text1" field??.
Thanks.....
Use this as 'validation' script of 'Text1' field:
this.getField("Text2").value = event.value.split(" ").pop();
Copy link to clipboard
Copied
Use this as 'validation' script of 'Text1' field:
this.getField("Text2").value = event.value.split(" ").pop();
Copy link to clipboard
Copied
Thanks Nesa! 😉
Copy link to clipboard
Copied
The code above will work, but will allow the user to overwrite that value (unless Text2 is set to read-only).
If you don't want that then you should use a calculation script for Text2, instead.