# \[Popup\] Submit Voucher onlclick

**URL:** <https://forum.shopware.com/t/popup-submit-voucher-onlclick/39665>\
**Category:** International (English Only)\
**Tags:** programming\
**Created:** [8. September 2016 um 11:30 UTC](https://forum.shopware.com/t/popup-submit-voucher-onlclick/39665 "2016-09-08T11:30:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![U365](https://avatars.discourse-cdn.com/v4/letter/u/f1d935/32.png) [@U365](https://forum.shopware.com/u/U365)\
**Post date:** [8. September 2016 um 11:30 UTC](https://forum.shopware.com/t/popup-submit-voucher-onlclick/39665/1 "2016-09-08T11:30:17Z")

</div>

So i am trying to figure out this one couple days already… The idea was the make exit-popup button which would upon click add Vouch code (Discount) into cart.

(First the idea was to copy it)

What i have done sofar:

```
    FREE16
      
Click to Copy ↗  
Nein, danke

function ImportVoucher(element) {
    
    $('input[type=p2]').click(function(ev) {
    ev.preventDefault();
    $(this).siblings('input[type=p2]').removeClass('selected');
    $(this).addClass('selected');
    $('#sVoucher').val($('.selected').val());
    $temp.remove();
}

```

added id to Voucher field.

&nbsp;

Everything works fine, exept the add Voucher itself.

&nbsp;

If someone could assist.
