Hi,
How can I add action to button in component. Button is not selecting from inside the component in aem 6.2
please find below img for reference.
Thanks in advance.
Sandhya.
Solved! Go to Solution.
Views
Replies
Total Likes
Hi Sandya
You can write a click event associated with your button . (I assume the button you are referring here should be the one labelled Convert ? )
Add a class or div id to you button's HTML and as smacdonald2008 Scott mentioned , write a javascript/jquery function for the click event associated with the class or div .
This may help you https://api.jquery.com/click/
PS:- Above solution is in an assumption that you are looking to attach an event to your button in your page . (Since your query doesn't have much details to explore more )
Thanks
Veena
Views
Replies
Total Likes
If you are using HTL - then use JavaScript to drive an action on a button in the component. Using HTL - you can use a ClientLib that contains the JS file - as shown in this article:
Scott's Digital Community: Creating an AEM HTL component that uses JavaScript
Hi Sandya
You can write a click event associated with your button . (I assume the button you are referring here should be the one labelled Convert ? )
Add a class or div id to you button's HTML and as smacdonald2008 Scott mentioned , write a javascript/jquery function for the click event associated with the class or div .
This may help you https://api.jquery.com/click/
PS:- Above solution is in an assumption that you are looking to attach an event to your button in your page . (Since your query doesn't have much details to explore more )
Thanks
Veena
Views
Replies
Total Likes
Hi Sandhya,
It's same as normal html and js. if you want the button to be functional then you need to specify the logic in js.
and use clientlib to call the js into your component and js function into the html file.
Please check above link. you will get to know about it.
~ Prince
Views
Replies
Total Likes
Hey Scott,
Can we put the onclick / click end in our client lib ?
Views
Replies
Total Likes
Yes - you can put JS that handles a click event in a client lib.
This article will help you -- Scott's Digital Community: Creating an AEM HTL component that uses JavaScript
Views
Replies
Total Likes
thank you Scott
Views
Replies
Total Likes
Views
Likes
Replies