Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Selecting from dropdown and fields are prepopulated

Avatar

Level 4

If you select from the dropdown (payperiods list) say for instance payperiod 15: 7/5/2009 - 7/18/2009, the prepopulated payperiod fields will appears as e.g. 7/5 - I would like for it to show as Sunday - July 5 instead of 7/5 in the textfield.

Thanks in advance

7 Replies

Avatar

Former Community Member

There are no functions in Javascript that will return to you the day of the week and the month in words. They will return a value that represents the days of th eweek 0 for Sunday, 1 for Monday etc... The same is true for the month. I have coded a large if condition to determine the daty and you can do the same for the month. You might find it easier to use a Switch statement but you wil have to turn the coded month into the appropraite word to get what you want.

See my attached sample. The code is on the exit event of the dropdown.

Paul

Avatar

Level 10

Try to make use of printd and scand methods available in Util object..

I ve attached a JS guide. This should help you.

PS: See page 264 of the attachment

Nith

Avatar

Former Community Member

Hi Nith,

I have a requirment to create a button called "Index" in a pdf.

When I click on that button it should show the popup menu and if I click any of the menuitem in that, it should take me to that particular page. I saw some of the interactive pdf's has this and I tried to incorporate this into my pdf, it shows the popup menu item correctly but not taking me to that particular page.

Below is the code I tried for your reference.

My question: Is there any way to populate this popup menu with the action to go to particular page from the bookmarks of a pdf?

Please help me. Thanks in advance.

var itemInedex = app.popUpMenu("Executive summary", "Why backups?", "Defining the data status (consistency)", "New disk technologies", "Understanding disaster recovery and restart and recovery", "Drawbacks with backups", "Backup in mainframe", "Schematic presentation", "For more information")

switch (itemIndex) {

case "Executive summary":
this.pageNum = 0
break

case "Why backups?":
this.pageNum = 3
break

case "Defining the data status (consistency)":
this.pageNum = 4
break

case "New disk technologies":
this.pageNum = 5
break

case "Understanding disaster recovery and restart and recovery":
this.pageNum = 6
break

case "Drawbacks with backups":
this.pageNum = 7
break

case "Backup in mainframe":
this.pageNum = 8
break

case "Schematic presentation":
this.pageNum = 9
break

case "For more information":
this.pageNum = 10
break
}

Avatar

Level 10

One typo issue on your code.

Your variable is declared as itemInedex  but it is refered as itemIndex  . That might be the problem.

I tired the following code, it works.

var itemIndex = app.popUpMenu("Executive summary", "Why backups?", "Defining the data status (consistency)", "New disk technologies", "Understanding disaster recovery and restart and recovery", "Drawbacks with backups", "Backup in mainframe", "Schematic presentation", "For more information")


switch (itemIndex) {  case "Executive summary":
xfa.host.currentPage = 1
break
case "Why backups?":
  xfa.host.currentPage =2
break
case "Defining the data status (consistency)":
  xfa.host.currentPage = 3
break
case "New disk technologies":
this.pageNum = 5
break
case "Understanding disaster recovery and restart and recovery":
this.pageNum = 6
break
case "Drawbacks with backups":
this.pageNum = 7
break
case "Backup in mainframe":
this.pageNum = 8
break
case "Schematic presentation":
this.pageNum = 9
break
case "For more information":
this.pageNum = 10
break
}

Also note that  I have used xfa.host.currentPage property

Nith

Avatar

Level 1

Hi,

How are you?

I have the same question, is there any solution to create a popupmenu from acrobat dc bookmarks?

I'll be very greatfull your help!!

Avatar

Level 5

Hi,

Are you developing in Livecycle Desginer? if not , you probably want to post your question on the Acrobat JavaScript forum.

Regards

Malcolm