Subversion Repositories SmartDukaan

Rev

Rev 9464 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
9447 manish.sha 1
$(function() {
2
	$('#sendProductFeedForm').live('submit', function() {
3
		var catalogItemId = $("input[name='cataLogItemId']").val();
4
		if(catalogItemId==null || catalogItemId=="")
5
		{
6
			alert("Please enter Catalog Item Id");
7
			$('input[name=cataLogitemId]').focus();
8
			return false;
9
		}
10
		sendProductFeeds($(this).serialize());
11
		return false;
12
	});
13
 
14
	$('#cataLogItemId').keypress(function(e) {
15
		var a = [];
16
            var k = e.which;
17
 
18
            for (i = 48; i < 58; i++){
19
        		{
20
                	a.push(i);
21
        		}
22
        	}
23
 
24
            if (!(a.indexOf(k)>=0)){
25
                e.preventDefault();
26
        	}
27
	});
28
 
29
	$('#sendProductFeedLink').live('click', function() {
30
		$("div#sendProductFeedDiv").show();
31
		$.colorbox({
32
            inline : true,
33
            width : "400px",
34
            height : "140px",
35
            href : "div#sendProductFeedDiv",
36
            onClosed : function() {
37
                $("div#sendProductFeedDiv").hide();
38
            }
39
		});
40
	});
41
 
42
});
43
 
44
function sendProductFeeds(params) {
45
	$.ajax({
46
		type : "POST",
47
		url : "/inventory/product-feeds!sendProductFeeds",
48
		data : params,
49
		success : function(response) {
50
			alert(response);
51
			$.colorbox.close();
52
		},
53
		error : function() {
54
			alert("Error in sending products feeds");
55
			$.colorbox.close();
56
		}
57
	});
58
}