Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


PDF PrepareForm text box: How to replace windows UNC path to Absolute path name in URI notation

Community Beginner ,
Sep 14, 2021 Sep 14, 2021

Copy link to clipboard

Copied

I have a text field that my user will enter a windows UNC path \\server\share. Is it possible to have a java script on that text fied that will change that path to be an Absolute path name in URI notation & make it a clickable link? 

The manual process is to paste the windows UNC path, then highlight it, right click to create a hyperlink, then paste that same windows UNC path and chage the backslashes "\" to be forwardslashes "/". 

TOPICS
Comment review and collaborate PDF, How to, JavaScript, PDF forms

Views

64

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
Adobe Community Professional ,
Sep 14, 2021 Sep 14, 2021

Copy link to clipboard

Copied

Sure, it's a simple reg-exp command (to be used as a custom Validation or Calculation script):

event.value = event.value.replace(/\\+/g, "/");

 

You can't define it as a hyperlink automatically, though.

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
Community Beginner ,
Sep 15, 2021 Sep 15, 2021

Copy link to clipboard

Copied

Try67,

That script work for the most part but when it runs it replaced the "\\" with the "//" but also the share of "\" was replace with 2 "//" vs one.

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
Adobe Community Professional ,
Sep 15, 2021 Sep 15, 2021

Copy link to clipboard

Copied

Sorry, I don't follow. Can you provide an example?

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
Community Beginner ,
Sep 16, 2021 Sep 16, 2021

Copy link to clipboard

Copied

try67 -  When the script ran it change the share name to double slashes when it needed to be one slash. EX \\server\share ended up being //server//share. I would like it to be //server/share

 

 

Thank you!

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
Adobe Community Professional ,
Sep 16, 2021 Sep 16, 2021

Copy link to clipboard

Copied

It doesn't do that for me... Can you share your file?

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
Community Beginner ,
Sep 16, 2021 Sep 16, 2021

Copy link to clipboard

Copied

try67- I told you incorrectly. When the script ran (either as a validation or calculated) it changes the share name to SINGLE slash when it needed to be two slashes. EX \\server\share ended up being /server/share. I would like it to be //server/share

 

 

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
Adobe Community Professional ,
Sep 16, 2021 Sep 16, 2021

Copy link to clipboard

Copied

Remove the "+" sign from the RegExp, then.

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
Community Beginner ,
Sep 16, 2021 Sep 16, 2021

Copy link to clipboard

Copied

Thank you try67! that worked.

 

Do you know of anyway in the adobe javascript tools guilde to make that an hyperlink?

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
Adobe Community Professional ,
Sep 16, 2021 Sep 16, 2021

Copy link to clipboard

Copied

LATEST

No, sorry.

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