JavaScript Needed - Remove digits from beginning and end

New Here ,
Jun 15, 2022 Jun 15, 2022

Copy link to clipboard

Copied

Hello Smarter Than Me People...  I have a field (ID Field) that will populate a 9 digit number.  I need that number to populate into another field (New ID) without the first digit and last 2 digits.  Any chance someone can help me out with the JavaScript for this?

TOPICS
JavaScript

Views

23

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

correct answers 1 Correct answer

Adobe Community Professional , Jun 15, 2022 Jun 15, 2022

As the custom calculation script of "New ID" enter the following:

var oldId = this.getField("ID Field").valueAsString;
if (oldId.length==9) event.value = oldId.substr(1,6);
else event.value = "";

Likes

Translate

Translate
Adobe Community Professional ,
Jun 15, 2022 Jun 15, 2022

Copy link to clipboard

Copied

LATEST

As the custom calculation script of "New ID" enter the following:

var oldId = this.getField("ID Field").valueAsString;
if (oldId.length==9) event.value = oldId.substr(1,6);
else event.value = "";

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