Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

Text Field - Default Value


Former Community Member

I have a text field for which I'd like to have the default value automatically disappear once the user puts the cursor into the field. How is this possible?

Also, I'd like to configure the field such that the default value does not print if the user has not replaced it. Is this possible?

Any thoughts are appreciated.

1 Reply


Former Community Member
since thoughts are appreciated ...

I had added a similar script but in an AcroForm..

ON FOCUS: (Enter)

if (event.target.value == event.target.defaultValue)

event.target.value = "";

ON BLUR: (Exit)

if (event.target.value.length == 0)

event.target.value = event.target.defaultValue;

The bad news is ... I unfortunately never managed to find the Livecycle equivalent to check against a default value though..(a generic way)