How to click on button in Adobe AEM form using javascript | Community
Skip to main content
June 27, 2022
Solved

How to click on button in Adobe AEM form using javascript

  • June 27, 2022
  • 2 replies
  • 1571 views

I am new to AEM and wanted to test the form using javascript. In my AEM form there is button which clears all the fields value.

I need to click on that button using javascript.

I am not able to find any function for click or press in given document.

https://opensource.adobe.com/dc-acrobat-sdk-docs/acrobatsdk/pdfs/acrobatsdk_jsapiref.pdf

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SantoshSai

@arvind12 Unfortunately not! Since, JS is served from the clienlib, you cannot inject it at runtime. However, you can use your favourite IDE to integrate it to AEM clientlib. 

2 replies

sunil_kumar_
Level 5
June 27, 2022

Hi @arvind12 Assuming, you are using Custom/OOTB form component, JQuery/Java script code should be part of clientlib. 

SantoshSai
Community Advisor
Community Advisor
June 27, 2022

Hi @arvind12 ,

In AEM - JS,CSS, etc. keeps under one folder that's called clientlib. To render your script based on some event you should have your JavaScript implemented in clientlib. For how to create clientlib please go through these below links.

  1. http://www.sgaemsolutions.com/2017/06/clientlibs-in-aem-63-part1.html
  2. http://www.sgaemsolutions.com/2017/06/clientlibs-in-aem63-part2_25.html

You can also visit this article to include JavaScript in different ways: https://sourcedcode.com/blog/aem/how-to-include-javascript-for-an-aem-website

Hope that helps!

Regards,

Santosh

Santosh Sai
arvind12Author
June 27, 2022

Is there something which I can try/run with JavaScript Console within Adobe?

 

SantoshSai
Community Advisor
SantoshSaiCommunity AdvisorAccepted solution
Community Advisor
June 27, 2022

@arvind12 Unfortunately not! Since, JS is served from the clienlib, you cannot inject it at runtime. However, you can use your favourite IDE to integrate it to AEM clientlib. 

Santosh Sai