aem component from front end to backend call
I have a requirement like for a checkbox or toggle bar on the AEM page When a checkbox or toggle bar is true should call one search script that is present in the page component of the template when it is false
It should call another search script that is also present in the page component of the template.
What should be the correct way to call these scripts?
Thanks.