<div class="discount">
  <h3><?php echo $this->__('Discount Codes') ?></h3>
<form id="discount-coupon-form" action="<?php echo $this->getUrl('checkout/cart/couponPost') ?>" method="post">                       
            <label for="coupon_code"><?php echo $this->__('Enter your coupon code if you have one.') ?></label>
            <input type="hidden" name="remove" id="remove-coupone" value="0" />                          
                <input  class="input-text fullwidth" type="text" id="coupon_code" name="coupon_code" value="<?php echo $this->htmlEscape($this->getCouponCode()) ?>" />                                                      
                  <button type="button" title="<?php echo $this->__('Apply Coupon') ?>" class="button coupon " onclick="discountForm.submit(false)" value="<?php echo $this->__('Apply Coupon') ?>"><span><?php echo $this->__('Apply Coupon') ?></span></button>                
                <?php if(strlen($this->getCouponCode())): ?>
                    &nbsp; <button type="button" title="<?php echo $this->__('Cancel Coupon') ?>" class="button" onclick="discountForm.submit(true)" value="<?php echo $this->__('Cancel Coupon') ?>"><span><?php echo $this->__('Cancel Coupon') ?></span></button>
                <?php endif;?>               
</form>
<script type="text/javascript">
//<![CDATA[
var discountForm = new VarienForm('discount-coupon-form');
discountForm.submit = function (isRemove) {
    if (isRemove) {
        $('coupon_code').removeClassName('required-entry');
        $('remove-coupone').value = "1";
    } else {
        $('coupon_code').addClassName('required-entry');
        $('remove-coupone').value = "0";
    }
    return VarienForm.prototype.submit.bind(discountForm)();
}
//]]>
</script>
</div> <!--discount-->