Planet PDF Forum Planet PDF Forum
  New Posts New Posts RSS Feed - Unique ID
  FAQ FAQ  Forum Search   Register Register  Login Login

Hi, welcome to the Foxit Planet PDF Forum. If you have PDF or Adobe Acrobat questions then the right place to ask them is here, in this forum.

Unique ID

 Post Reply Post Reply
Author
jhinckley View Drop Down
New Member
New Member


Joined: 29 Dec 2011
Points: 8
Post Options Post Options   Quote jhinckley Quote  Post ReplyReply Direct Link To This Post Topic: Unique ID
    Posted: 29 Dec 2011 at 9:24pm
I came across the code shown at the bottom of the post, and it does pretty much what I want but not completely. It enters a unique id number in the correct field upon opening the form which is what I thought I wanted at first. Now I think it would be better if after the user completes the form and presses the submit button, that that action first generates the number, enters it into the field and then sends the form to the specified e-mail address.
 
Is this possible?
 
var f = this.getField("NCR#");
var g = f.value;
if (g == 0)
{
var dt;
Today = new Date();
dt = Today.getTime();
this.getField("NCR#").value = dt;
}
Back to Top
gkaiseril View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Location: USA
Points: 4111
Post Options Post Options   Quote gkaiseril Quote  Post ReplyReply Direct Link To This Post Posted: 29 Dec 2011 at 9:37pm
Yes, but you will have to write a custom JavaScript for the submit button action.
Back to Top
try67 View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Points: 634
Post Options Post Options   Quote try67 Quote  Post ReplyReply Direct Link To This Post Posted: 30 Dec 2011 at 12:13pm
Not necessarily. You can add the code, as it is, to a Execute JavaScript action, and then add a separate Submit Form action after that, which doesn't involve any JavaScript code.
- Acrobat Expert - Contact me personally at try6767@gmail.com
Check out my custom-made scripts website: http://try67.blogspot.com
Back to Top
gkaiseril View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Location: USA
Points: 4111
Post Options Post Options   Quote gkaiseril Quote  Post ReplyReply Direct Link To This Post Posted: 30 Dec 2011 at 8:57pm
If you want to make sure the id is added before the submit action, I would write the entire process as one action since the actions run asynchronously, that is the first action does not need to complete before the following actions are run.
Back to Top
jhinckley View Drop Down
New Member
New Member


Joined: 29 Dec 2011
Points: 8
Post Options Post Options   Quote jhinckley Quote  Post ReplyReply Direct Link To This Post Posted: 14 Jan 2012 at 12:24am

I've thought about this some more and decided to run it in the Actions tab in the field. I've selected Mouse Exit as the trigger. Is that a good approach?

My new issue is that the number is 13 digits. Much too long. I'd like it to be six digits. Any help in modifying the original code to accomplish this would be much appreciated.
Back to Top
mmazal View Drop Down
New Member
New Member
Avatar

Joined: 20 Jan 2012
Location: Kitchener, ON
Points: 10
Post Options Post Options   Quote mmazal Quote  Post ReplyReply Direct Link To This Post Posted: 23 Feb 2012 at 1:40pm
old post so probably done already but...
 
var dt;
Today = new Date();
dt = util.printd("ddmmyy", Today);
//or change the "ddmmyy" to some other format
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.10
Copyright ©2001-2017 Web Wiz Ltd.

This page was generated in 0.031 seconds.