Formatting people's names case in a PDF form

New Here ,
Apr 24, 2022 Apr 24, 2022

Copy link to clipboard

Copied

Hi,

 

I am currently using the below script to automatically format a person's name in a pdf form:

 

if (event.value) {
var parts = event.value.split(", ");
if (parts.length==2) {
event.value = parts[0].toUpperCase() + ", " + parts[1].charAt(0).toUpperCase() + parts[1].substr(1).toLowerCase();
}
}

 

This works great, however if a person has a second first name (or middle name) the second name comes out with no capital, e.g SMITH, John david.  

 

Does anyone know an easy fix for this?

TOPICS
PDF forms

Views

15

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation