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

text field or button highlights on click. One click on, next click off,

Community Beginner ,
Sep 28, 2018 Sep 28, 2018

Copy link to clipboard

Copied

I am creating an assessment form for our preschool.

I have cells for each letter of the alphabet, numbers 1-20, Sounds, and several other areas.

They would like to be able to just click the field and have it highlight to show that the child completed the request.  Click and highlights green, click again and highlight is off, click on.....

TOPICS
Acrobat SDK and JavaScript , Windows

Views

958

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

correct answers 1 Correct answer

LEGEND , Oct 01, 2018 Oct 01, 2018

You could use the following for the Mouse Up script of a button to toggle the background color of the button between white and green:

// Mouse Up script for button

event.target.fillColor = color.equal(event.target.fillColor, color.white) ? color.green : color.white;

So for the Letter Identification section, you could add a button for each letter, setting the button label to that letter, and using the above script in the Mouse Up JavaScript action. If you want to use different colors and need help,

...

Votes

Translate

Translate
LEGEND ,
Sep 28, 2018 Sep 28, 2018

Copy link to clipboard

Copied

With a field, you can use JavaScript to set the background (fill) color, the border color and line thickness, and the text color, font, and size. So you can control  a number of things to achieve a highlight effect, and then change it back to an unhighlighted state when clicked again. Exactly how you do it depends on what type of fields you're using (buttons, text, checkboxes). You have the greatest flexibility with buttons, since you can set their icons to anything you want (anything that a PDF page can display).

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 Beginner ,
Sep 28, 2018 Sep 28, 2018

Copy link to clipboard

Copied

I have no experiance with Java. I would need assistance with that.  I was thinking that what ever has the least amount of steps would be best.  I can work with whatever field type would be best.

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
LEGEND ,
Sep 28, 2018 Sep 28, 2018

Copy link to clipboard

Copied

Can you give a more complete description of what you mean by "highlight", considering all of the things that I mentioned you can control?

The scripting will be fairly simple, so you will be able to pick it up easily from some sample scripts we can provide.

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 Beginner ,
Oct 01, 2018 Oct 01, 2018

Copy link to clipboard

Copied

They wanted it to look like the field was highlighted with a transparent colorNew assessment draft PDF_Page_2.jpg

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
LEGEND ,
Oct 01, 2018 Oct 01, 2018

Copy link to clipboard

Copied

You can't normally set a field color (border, fill, text) to have any transparency, though it is possible to include transparency with a button icon, but this won't be the easiest approach. Can you think of an acceptable alternative to using transparency, such as using a background or border color?

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 Beginner ,
Oct 01, 2018 Oct 01, 2018

Copy link to clipboard

Copied

I would link a background color would work perfectly

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
LEGEND ,
Oct 01, 2018 Oct 01, 2018

Copy link to clipboard

Copied

You could use the following for the Mouse Up script of a button to toggle the background color of the button between white and green:

// Mouse Up script for button

event.target.fillColor = color.equal(event.target.fillColor, color.white) ? color.green : color.white;

So for the Letter Identification section, you could add a button for each letter, setting the button label to that letter, and using the above script in the Mouse Up JavaScript action. If you want to use different colors and need help, post again.

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 Beginner ,
Oct 01, 2018 Oct 01, 2018

Copy link to clipboard

Copied

Thank you so very much. Sound like a plan.  I'll try that today!

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 Beginner ,
Oct 01, 2018 Oct 01, 2018

Copy link to clipboard

Copied

LATEST

That worked perfectly!  Thank you so much for your help

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