I currently have the following:
$( "#Coupon" ).keyup(function() {
$(this).val (function () {
return this.value.toUpperCase();
})
var url = window.location.href;
var addon = $('#voucher').val();
$("#ApplyCoupon").attr('href', url + "&coupon=" + addon);
which checks a text field and then adds the content to a url variable to check if the coupon is vali the next time the page loads.
My issue is that if you check multiple coupons, it keeps adding &coupon=blah
Is there any way of just replacing the coupon variable in the URL instead of creating new ones?