Subversion Repositories SmartDukaan

Rev

Rev 9447 | Go to most recent revision | Details | Compare with Previous | 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();
9464 manish.sha 31
		$('#cataLogItemId').val('');
9447 manish.sha 32
		$.colorbox({
33
            inline : true,
34
            width : "400px",
9464 manish.sha 35
            height : "160px",
9447 manish.sha 36
            href : "div#sendProductFeedDiv",
37
            onClosed : function() {
38
                $("div#sendProductFeedDiv").hide();
39
            }
40
		});
41
	});
42
 
43
});
44
 
45
function sendProductFeeds(params) {
46
	$.ajax({
47
		type : "POST",
48
		url : "/inventory/product-feeds!sendProductFeeds",
49
		data : params,
50
		success : function(response) {
51
			alert(response);
52
			$.colorbox.close();
53
		},
54
		error : function() {
55
			alert("Error in sending products feeds");
56
			$.colorbox.close();
57
		}
58
	});
59
}