I have created a multi-field pdf form that includes a button that generates an email. The email body contains content of specified fields. All this is working fine. The issue is that in one of the fields, a network path is entered. When the email is generated that information is included in the body of the email and often the resulting link is broken, because the path often contains spaces in the path name. It seems that i can fix this issue if the empty spaces in the path are replaced by %, for example, prior to having users generate the email.
Thank you so much in advance for your help!!!!
Solved! Go to Solution.
tfFieldWithoutSpaces.rawValue = tfFieldWithSpaces.rawValue.replace(/ /g,'%');
But if this is part of a link, do you want %20 instead? That's the URL equivalent of a space.
tfFieldWithoutSpaces.rawValue = tfFieldWithSpaces.rawValue.replace(/ /g,'%20');
THank so much for the quick reply!
I'm not seeing any data at all populating in my FieldWithoutSpaces - do I need to set that field a certain way? And yes, thank you, I do want a space, so I guess I do want '%20'
Thanks so much!!! That seems to work!!! - at least to replace the characters as requested...now the link is not being understood - so that's the next hurdle - but I appreciate your scripting help!!!! Any advice on the link appreciated -
Like I said earlier, a space in a URL or equivalent file path is usually changed to %20 instead of a space. Have you tried using that in the replace function?
Thank you!!! Your help with the replace option worked perfectly!!! I was able to replace the spaces with %20 using your code above...at that point I still had an issue because the resulting NETWORK link (vs. hyperlink) was no longer being recognized when it was copied into my auto-generated email (it didn't understand %20)...but I solved that too by adding the'File://' + to the tfFieldWithSpaces exit event:
tfFieldWithNoSpaces.rawValue = 'File://' + this.rawvalue.replace (/ /g, '%20');
And now my auto-generated email contains a link to the network path as needed!