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

Fromatting date

Explorer ,
Oct 02, 2024 Oct 02, 2024

Copy link to clipboard

Copied

Hello

I need creat java script :

When I take copy of date
Such as formate : 20241028

And past at feild will be shown
28-10-2024 start from

Add Word (start from)
And add symbol (-) to date

TOPICS
Create PDFs , Edit and convert PDFs , How to , JavaScript , PDF , PDF forms

Views

629

Translate

Translate

Report

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
3 ACCEPTED SOLUTIONS
Community Expert ,
Oct 02, 2024 Oct 02, 2024

Copy link to clipboard

Copied

Enter the following custom format script:

 

if(event.value)
{
var date=util.scand("yyyymmdd", event.value);
event.value="start from "+ util.printd("dd-mm-yyyy", date)+ " -";
}

View solution in original post

Votes

Translate

Translate

Report

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 ,
Oct 03, 2024 Oct 03, 2024

Copy link to clipboard

Copied

My mistake.  Did Print.  That runs after you print.  Will print runs when you trigger print but before it actually prints.  So if you want the field values to show up on the print, it's Did Print.  Then they will reset after you print.

View solution in original post

Votes

Translate

Translate

Report

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 ,
Oct 04, 2024 Oct 04, 2024

Copy link to clipboard

Copied

Yes.  You have to set it with a script if by "empty" you mean no value.  You use a space.  It will look empty (the space).

View solution in original post

Votes

Translate

Translate

Report

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 ,
Oct 02, 2024 Oct 02, 2024

Copy link to clipboard

Copied

Enter the following custom format script:

 

if(event.value)
{
var date=util.scand("yyyymmdd", event.value);
event.value="start from "+ util.printd("dd-mm-yyyy", date)+ " -";
}

Votes

Translate

Translate

Report

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
Explorer ,
Oct 02, 2024 Oct 02, 2024

Copy link to clipboard

Copied

It is Working dear 

On more thing 

Can create script when i print pdf 

Feild be reset from any data 

Votes

Translate

Translate

Report

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 ,
Oct 02, 2024 Oct 02, 2024

Copy link to clipboard

Copied

Before print or after?

Votes

Translate

Translate

Report

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
Explorer ,
Oct 02, 2024 Oct 02, 2024

Copy link to clipboard

Copied

After prrint  dear 

Votes

Translate

Translate

Report

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 ,
Oct 03, 2024 Oct 03, 2024

Copy link to clipboard

Copied

With the new Acrobat disabled, search "Document" in the tools tab, then select "Document Actions" under "JavaScript", then "Did Print":

PDFAutomationStation_0-1727954916976.pngPDFAutomationStation_1-1727954956070.png

Enter the following script:

this.resetForm();

 

Votes

Translate

Translate

Report

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
Explorer ,
Oct 03, 2024 Oct 03, 2024

Copy link to clipboard

Copied

Dear

I think should choose 

Document will print 

Or

Document did print

What is different between them

Regards.

Votes

Translate

Translate

Report

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 ,
Oct 03, 2024 Oct 03, 2024

Copy link to clipboard

Copied

My mistake.  Did Print.  That runs after you print.  Will print runs when you trigger print but before it actually prints.  So if you want the field values to show up on the print, it's Did Print.  Then they will reset after you print.

Votes

Translate

Translate

Report

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
Explorer ,
Oct 03, 2024 Oct 03, 2024

Copy link to clipboard

Copied

Many thanks dear 

Have ance day 

Votes

Translate

Translate

Report

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
Explorer ,
Oct 04, 2024 Oct 04, 2024

Copy link to clipboard

Copied

Dear 

I use this script to reset specific field from data when (did print)

I is working okay at all fields except field (dropdown)

Can check where is mistake at below script:

//array of the field names to clearvar aFields = new Array("text1","text2","text3","Dropdown1");
//clear the field in the array of namesthis.resetForm(aFields);

Votes

Translate

Translate

Report

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 ,
Oct 04, 2024 Oct 04, 2024

Copy link to clipboard

Copied

What is the default value of the Dropdown1, and is Dropdown1 spelled correctly, including spacing and case sensitivity?

Votes

Translate

Translate

Report

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
Explorer ,
Oct 04, 2024 Oct 04, 2024

Copy link to clipboard

Copied

Yes dear Dropdown1 spelled correctly

But default value I don't have.

I have only three choices from drop down list

Screenshot_20241004_214119.jpg

Can I have empty default value at drop  down list? 

Votes

Translate

Translate

Report

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 ,
Oct 04, 2024 Oct 04, 2024

Copy link to clipboard

Copied

Yes.  You have to set it with a script if by "empty" you mean no value.  You use a space.  It will look empty (the space).

Votes

Translate

Translate

Report

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
Explorer ,
Oct 05, 2024 Oct 05, 2024

Copy link to clipboard

Copied

It is Working 

Many thanks

Votes

Translate

Translate

Report

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 ,
Nov 05, 2024 Nov 05, 2024

Copy link to clipboard

Copied

LATEST

This will not work in a PDF form.

Votes

Translate

Translate

Report

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