Skip to main content
eduardoj64332811
Known Participant
July 20, 2018
Question

JAVASCRIPT CODE ON COUNTDOWNING PDF FORM

  • July 20, 2018
  • 1 reply
  • 431 views

Hello,

I put a JavaScript code at my pdf form. This JavaScript code its use for countdown.

I would like to know is its possible to insert in my JavaScript code:

- When the user download my PDF Form, the " Begin Time" starts ( todays date )

- And i would like to put a " End Time" example  a 1 year, 6 months, etc.. after the Begin Time automatically

This is my actually javacript code:

function Expire ()

{

// Obtém a data e hora atuais

var rightNow = new Date ();

// Setup End Date

var rightNow = new Date ();

var beginDate = new Date ();

var endDate = new Date ("5 minutos");

if (rightNow <beginDate || rightNow> endDate)

{

app.alert ("Passou do limite de tempo. Você não pode usar mais este documento.Entre em contato para continuar a usar este documento. Obrigado.", 0, 0);

this.closeDoc ()

}

}

// executa o código de expiração de verificação

Expire ();

Can you help me please??!

Thank You!!!

This topic has been closed for replies.

1 reply

Inspiring
July 20, 2018

There are a number of problems with trying to implement this sort of thing reliably with JavaScript. Your first hurdle will be establishing the begin date and storing it somewhere. If you do manage to store it somewhere, it has to be saved in a location that can be accessed each time the document is opened. There are just too many uncertainties with this approach that makes it unviable. Such a scheme could be very easily defeated.