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

PDF Forms: Pop to show correct result when hover the mouser over form field

Community Beginner ,
Jun 11, 2021 Jun 11, 2021

PDF Forms: Pop to show correct result when hover the mouser over form field

 

I'm creating quiz and I want some sort of pop up to show correct result when i hover over field with mouse
but i don't want it to be alert, is there something else i could use to make it work other then app.alert?

 

[Edited the Subject with the as per the query: Mod]

TOPICS
How to , JavaScript
1.7K
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 ,
Jun 11, 2021 Jun 11, 2021

Yes, you can add this as 'Mouse enter' event:

app.popUpMenu("Correct result is XXX");

Change text as you want.

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 ,
Jun 11, 2021 Jun 11, 2021

Yes, you can add this as 'Mouse enter' event:

app.popUpMenu("Correct result is XXX");

Change text as you want.

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 Beginner ,
Jun 11, 2021 Jun 11, 2021

That is actually nice, I take a look into guide for app.popUpMenu and I see that i can also add sub items,this will be useful for my project,thank you so much.

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 ,
Jun 11, 2021 Jun 11, 2021

Use the field's built-in Tooltip property.

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 Beginner ,
Jun 11, 2021 Jun 11, 2021

I knew already about tooltip but i gave up on it because it doesn't allow me much control over where inserting new line, because some aswers are long text and there is also multiple answers. But still thank you for your time i appreciate it.

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 ,
Jun 11, 2021 Jun 11, 2021

Actually, you can control it, but only if you apply the tooltip using a script, like this:

 

this.getField("Text1").userName = "Tooltip line 1\nTooltip line 2";

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 ,
Jun 11, 2021 Jun 11, 2021
LATEST

Here's an article on using popup menus:

https://www.pdfscripting.com/public/Creating-Popup-Menus.cfm

 

However, I'd be careful with this function. It is not implemented on most PDF viewers. You are better off going with a strategy that uses more common PDF features. For example hiding/showing fields. This is something you can do with no scripting at all for a simple rollover. Or if more complex behavior is required, hide/show scripts are more widely implemented than popup menus.

https://www.pdfscripting.com/public/Hiding-and-Showing-Form-Fields.cfm?sd=40

 

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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