用户使用Addthis后显示优惠券

I see addthis has some sample code that may help: http://www.addthis.com/help/client-api#events

In my registration form, I want to display a coupon code in an input text field IF they share my site. Any ideas on how I could do this?

In the HTML, give your input field an id so you can reference it later:

<input type="text" id="coupon-code" value="">

Then, here's the addthis listener:

<script type="text/javascript">
    addthis.addEventListener('addthis.menu.share', function(evt) {
        // Show coupon code
        document.getElementById('coupon-code').value = "CODE12345";
    });
</script>