Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

92
Vistas
Random number generated per .pdf form

I'm creating a .pdf form in Foxit which needs to be able to generate a random, unique number each time the form is used. I presume the use of a button with javascript embedded is my best option however have not been successful in creating this. Suggestions?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

var randomNumberField = this.getField("foo");

Do you have a "foo" field to run this on and to later populate with a number?

if you do, it's as simple as:

 var randomNumberField = this.getField("foo")
 if (randomNumberField .value.length == 0) {
 randomNumberField .value = util.printf("%06d", Math.floor((Math.random() * 100000000) + 1));
 }

and setting the field to be ReadOnly. code taken from here

no need for a button or anything, it runs on document load (i think?).

example pdf file (that will expire in 30 days....): https://easyupload.io/ew86ge

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda