Jump to content

onClick function does not work on any place.


XIMPLIO

Recommended Posts

Hello,

I tried to implement js script to product description, but when I add html form with onclick function, prestashop does not let me save this description. I tried with import, but there is error: product description is invalid.

Is there any way to add onclick function to product description?

I have html purifier disabled.

Link to comment
Share on other sites

2 hours ago, XIMPLIO said:

I need to make onClick form which must be added in html file in description.

You can do this without adding onClick into html file. In js you can point element by it class or id and have same result like onClick.

Link to comment
Share on other sites

Thank you for help, I did as endriu107 adviced.

Later I was not able to put the script itself in product description, because there was an error, however I added only html with form and script in product.tpl file.

I would prefere to not put the script in every product page, but only product I want, however it finally works.

The script is only trigerred with the button in form in this exact product.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...