Answered
Duplicate text
Hi, I have two text fields and wish to duplicate text from "Text1" to "Text2" but only last 3 words.
Hi, I have two text fields and wish to duplicate text from "Text1" to "Text2" but only last 3 words.
You can use this as validate script of "Text1" field:
var text = event.value ? event.value.trim() : "";
if (text === "") {
this.getField("Text2").value = "";}
else {
var words = text.split(/\s+/);
this.getField("Text2").value = words.slice(-3).join(" ");}
Already have an account? Login
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.