Skip to main content
Participating Frequently
September 28, 2018
Answered

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

  • September 28, 2018
  • 1 reply
  • 1535 views

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

This topic has been closed for replies.
Correct answer George_Johnson

I would link a background color would work perfectly


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.

1 reply

Inspiring
September 28, 2018

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

NancyCateAuthor
Participating Frequently
September 28, 2018

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.

George_JohnsonCorrect answer
Inspiring
October 1, 2018

I would link a background color would work perfectly


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.