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

Javascript combo box with rollover: make rollover function while mouse hovers over all items

New Here ,
Jun 30, 2022 Jun 30, 2022

Copy link to clipboard

Copied

Thanks in advance for reading.

 

I designed an interactive pdf form in indesign, with javascripting in acrobat. Currently, there are rollover actions that reveal instruction buttons when the mouse hovers over the combo box. 

 

Is it possible to write a javascript (or by other means, though I'm doubtful) that reveals the instruction button throughout the 'drop down process', or while the user's mouse is hovering over the various items in the list of the dropdown? 

 

I tried adding both a Mouse Enter/Mouse Exit (show/hide field) action and a On Focus/On (show/hide field) action. On a Text Field, On Focus works to trigger another field as long as the user's cursor is in the text box. But in the combo box with the actions above, the linked field (instruction button) is triggered to hide as soon as the mouse leaves the combo box to hover over the items in the list or move elsewhere on screen.

Frustrating.

 

TOPICS
JavaScript , PDF forms

Views

235

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 ,
Jun 30, 2022 Jun 30, 2022

Copy link to clipboard

Copied

No, it's not possible.

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
Participant ,
Jul 08, 2022 Jul 08, 2022

Copy link to clipboard

Copied

LATEST

Many thanks again, Try67.

Mind if I send you a different problem?

 

I have a Total Field and fields for Mon 1, Tue 1, Wed 1, Thur 1, Fri 1, Sat 1 and Sun 1.

The user will either:

1. Enter their scheduled hours where applicable across Mon 1 through Sun 1, with a possible range of 0-12 per day. In this instance, I need Mon 1-Sun 1 to each verify the range. But the default value of each field must remain "Mon" , "Tue" , "Wed", "Thu" , "Fri", "Sat" and "Sun", respectively, because I use On Focus and On Blur scripts (see below) to instruct the user. The string (i.e. "Mon") should appear in the box, but also return a value of 0 should the user leave a day of the week blank while filling their schedule. Additionally, if the user enters numbers (above 0) into any of the Mon 1-Sun 1 fields, I need Total Field to calculate the total and for the Total Field to become uneditable. Essentially, if the user enters her schedule, the Total Field should always match the total value for the days of the week. If the user removes the values from all days, the total should become editable again. I myself have a button that shows or hides the schedule upon click. Hiding the schedule also clears the schedule. I assume this functionality will work independently from the script I require here. But I include the info FYI.

2. The user can not fill in their schedule and instead only fill in their total hours in Total Field. The range for Total Field must be 1-37.5, where the default value is "Total". 

 

I'm using these scripts on the fields to instruct the users:

 

//On Focus//

if (event.target.value==event.target.defaultValue) { event.target.value = ""; event.target.textColor = color.black; }

 

//On Blur//

if (event.target.value=="") { event.target.value = event.target.defaultValue; event.target.textColor = color.ltGray; }

 

Your help is much appreciated! (Also any best-practice suggestions are gratefully accepted.)

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