How can I populate a field from part of another field?

Jun 28, 2018

Copy link to clipboard

Copied

What I am looking to do is the user enters data into a field with an arbitrary mask (AAA99999A99999) and I wand to take the last 6 characters and have it populate into another field automatically.  I haven't been able to find an answer on my own.

Thanks for any assistance.

--Marnin

TOPICS
Acrobat SDK and JavaScript, Windows

Views

83

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

How can I populate a field from part of another field?

Jun 28, 2018

Copy link to clipboard

Copied

What I am looking to do is the user enters data into a field with an arbitrary mask (AAA99999A99999) and I wand to take the last 6 characters and have it populate into another field automatically.  I haven't been able to find an answer on my own.

Thanks for any assistance.

--Marnin

TOPICS
Acrobat SDK and JavaScript, Windows

Views

84

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
Jun 28, 2018 0
Adobe Community Professional ,
Jun 29, 2018

Copy link to clipboard

Copied

HI,

In the validate function of the field with the mask, you can add code something like this

var lastSix = event.value.substr ( event.value.length - 6, event.value.length);

// change Text2 to the name of the other field

this.getField("Text2").value = lastSix;

Hope this helps

Malcolm

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
Reply
Loading...
Jun 29, 2018 0
Jun 29, 2018

Copy link to clipboard

Copied

That did it.  Thanks so much.

--Marnin

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
Reply
Loading...
Jun 29, 2018 0