Skip to main content
Participant
August 30, 2021
Question

Wanting to auto-populate initials in a field based on the first of each word in another field.

  • August 30, 2021
  • 1 reply
  • 343 views

I am building a form. At the top of each page, I need the initials of the person listed in "Name Field" (Like John Smith) to be posted at the top of every page. To clarify not the signature type initials, just the typed "JS". 

 

This topic has been closed for replies.

1 reply

Nesa Nurani
Community Expert
Community Expert
August 31, 2021

Use script as validation script of "Name Field" and replace "Signature" field names to your actual field names and add more/less fields as needed:

var str = event.value;

if(event.value == ""){
this.getField("Signature1").value = "";
this.getField("Signature2").value = "";
this.getField("Signature3").value = "";}
else{
var r = str.split(" ");
var y = r[0].substr(0, 1)+r[1].substr(0, 1);
this.getField("Signature1").value = y;
this.getField("Signature2").value = y;
this.getField("Signature3").value = y;}