Skip to main content
Inspiring
October 2, 2024
Answered

Fromatting date

  • October 2, 2024
  • 2 replies
  • 1795 views

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

This topic has been closed for replies.
Correct answer PDF Automation Station

Yes dear Dropdown1 spelled correctly

But default value I don't have.

I have only three choices from drop down list

Can I have empty default value at drop  down list? 


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).

2 replies

Bernd Alheit
Community Expert
Community Expert
November 5, 2024

This will not work in a PDF form.

PDF Automation Station
Community Expert
Community Expert
October 2, 2024

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)+ " -";
}

ali_3480Author
Inspiring
October 2, 2024

It is Working dear 

On more thing 

Can create script when i print pdf 

Feild be reset from any data 

PDF Automation Station
Community Expert
Community Expert
October 3, 2024

Dear

I think should choose 

Document will print 

Or

Document did print

What is different between them

Regards.


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.