Add my own clientscript after an item (options product) is added to the basket


https://forum.kartris.com/Topic7111.aspx
Print Topic | Close Window

By [email protected] - Mon 4 Feb 2019
How can i add my own clientscript after an item (options product) is added to the basket?
By Paul - Tue 5 Feb 2019
Try the following. Open up the user control ProductVersions.ascx

In there, look for the btnAdd_Options button.

Add
 onclientclick="myfunction();"

This should fire your own javascript function when the button is clicked.

I tested with a simple 'alert' dialog and this seems to work, the code continues when that is closed.

If you want to do something more elaborate, this might help:

https://stackoverflow.com/questions/21227506/how-to-call-a-javascript-function-before-and-after-button-click-event-call-in-as

It shows how to run javascript after the server side click event, using registerscripts. But this is more complicated in my experience, the clientclick one is best if you can make your code run that way.
By [email protected] - Wed 10 Apr 2019
thanks