Subversion Repositories SmartDukaan

Rev

Rev 10784 | Rev 10953 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 10784 Rev 10817
Line 4... Line 4...
4
}
4
}
5
function applycoupon(){
5
function applycoupon(){
6
	debugger;
6
	debugger;
7
	var coupon = document.getElementById('couponcode').value;
7
	var coupon = document.getElementById('couponcode').value;
8
	if(coupon.length <= 0){
8
	if(coupon.length <= 0){
-
 
9
		if(document.getElementById('error').style.display == 'block'){
-
 
10
			document.getElementById('error').style.display = "none";	
-
 
11
		}
-
 
12
		var bRed = document.getElementById('couponcode');
-
 
13
        bRed.style.border = 'red solid 1px';
-
 
14
        bRed.style.color = 'red';
9
		alert("Please Enter a Coupon Code");
15
        bRed.value = 'Please enter the coupon code!' 
-
 
16
        setTimeout(function(){
-
 
17
          bRed.style.border = '';
-
 
18
          bRed.style.color = '';
-
 
19
          bRed.value = '';
-
 
20
        },3000);
-
 
21
        return false;
10
	}
22
	}
11
	else{
23
	else{
-
 
24
		if(document.getElementById('error').style.display == 'block'){
-
 
25
			document.getElementById('error').style.display = "none";	
-
 
26
		}
12
		var url = base_url+'cart/coupon/'+coupon;
27
		var url = base_url+'cart/coupon/'+coupon;
13
	    //window.location.href = a;
28
	    //window.location.href = a;
14
	    microAjax(url, function (res) {
29
	    microAjax(url, function (res) {
15
	    	debugger;
30
	    	debugger;
16
	    	var data = JSON.parse(res);
31
	    	var data = JSON.parse(res);