Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
2

campo data

Participant ,
Jul 15, 2023 Jul 15, 2023

Tenho um campo texto com o nome de data_actual, ao abrir o ficheiro em pdf ele busca a data atual.

Coloquei o seguinte javascript nele:

 

this.getField("data_actual").value = util.printd("dd/mm/yyyy", new Date());

 

O problema é que ele não actualiza o que devo fazer? aparece sempre a data anterior exibida nele

TOPICS
JavaScript , PDF , PDF forms
685
Translate
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
1 ACCEPTED SOLUTION
Community Expert ,
Jul 16, 2023 Jul 16, 2023

You need to move the code to a Doc-level script, under Tools - JavaScript - Document JavaScripts.

Make sure it's NOT in a function, though.

View solution in original post

Translate
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 Expert ,
Jul 15, 2023 Jul 15, 2023

Where did you place the code, exactly?

Translate
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
Participant ,
Jul 16, 2023 Jul 16, 2023

Boa noite,

Coloquei em:

Propriedades - Calcular - Script de Calculo personalizado.

Translate
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 Expert ,
Jul 16, 2023 Jul 16, 2023

You need to move the code to a Doc-level script, under Tools - JavaScript - Document JavaScripts.

Make sure it's NOT in a function, though.

Translate
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
Participant ,
Jul 16, 2023 Jul 16, 2023

Não entendi: Make sure it's NOT in a function, though.

E copio o meu codigo todo?

Translate
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 Expert ,
Jul 16, 2023 Jul 16, 2023
LATEST

Remove the function definition. Use your original code only.

Translate
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