Skip to main content
Participant
July 14, 2024
Answered

Auto Highlight Default Text Field Input

  • July 14, 2024
  • 2 replies
  • 528 views

Is there any way to make it so that when you click on a text field with a default value, highlight this when you click on it or clear out the field, whichever is easier?  I want the ability to click on the field to enter text right away, not have to delete what is defaulted in the field.  thank you.

This topic has been closed for replies.
Correct answer JR Boulay

Place this script in an "onFocus" action:

 

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

2 replies

PDF Automation Station
Community Expert
Community Expert
July 14, 2024

Add the following script as mouse enter action:

event.target.setFocus();

JR Boulay
Community Expert
JR BoulayCommunity ExpertCorrect answer
Community Expert
July 14, 2024

Place this script in an "onFocus" action:

 

if (event.target.value == event.target.defaultValue) {event.target.value = "";}
Acrobate du PDF, InDesigner et Photoshopographe