Subversion Repositories SmartDukaan

Rev

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

Rev 3830 Rev 4143
Line 94... Line 94...
94
	
94
	
95
	$('.util_addnewresearch').click(function(){
95
	$('.util_addnewresearch').click(function(){
96
		addResearch('', 'single');
96
		addResearch('', 'single');
97
	});
97
	});
98
	
98
	
99
	/* This code is for compare with button */
-
 
100
	var availableNames = [];
-
 
101
	for (var k in productIdNames)availableNames.push(k);
-
 
102
    $("#mobilename").autocomplete({  autoFocus: true, minLength: 3, 
-
 
103
        source: availableNames
-
 
104
    });
-
 
105
 
-
 
106
 
-
 
107
    $('#mobilename').keypress(function(e) {
99
    $('#mobilename').keypress(function(e) {
108
    	if(e.keyCode == 13) {
100
    	if(e.keyCode == 13) {
109
    		return compareProducts();
101
    		return compareProducts();
110
        }
102
        }
111
    });
103
    });
Line 132... Line 124...
132
    	});
124
    	});
133
    	
125
    	
134
    	
126
    	
135
    function compareProducts(){
127
    function compareProducts(){
136
		var productName = $("#mobilename").val();
128
		var productName = $("#mobilename").val();
137
		var productTwo = productIdNames[productName];
129
		var productTwo = typeof(productIdNames['mobiles'][productName]) == 'undefined' ? productIdNames['laptops'][productName] : productIdNames['mobiles'][productName];
-
 
130
		
138
		if(typeof productTwo == 'undefined'){
131
		if(typeof productTwo == 'undefined'){
139
			alert("Please select a valid product");
132
			alert("Please select a valid product");
140
			return false;
133
			return false;
141
		}
134
		}
142
		var productOne = $("#catalog_id").val();
135
		var productOne = $("#catalog_id").val();