Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
6322 amar.kumar 1
$(function() {
2
	$('#addPincodeForm').live('submit', function() {
3
		addPincode($(this).serialize());
4
		return false;
5
	});
6
 
7
	$('#updatePincodeForm').live('submit', function() {
8
		updatePincode($(this).serialize());
9
		return false;
10
	});
11
 
12
	$('#addPincodeLink').live('click', function() {
13
		$("div#addPincode").show();
14
		$.colorbox({
15
            inline : true,
16
            width : "400px",
17
            height : "220px",
18
            href : "div#addPincode",
19
            onClosed : function() {
20
                $("div#addPincode").hide();
21
            }
22
		});
23
	});
24
 
25
	$('#updatePincodeLink').live('click', function() {
26
        $("div#updatePincode").show();
27
		$.colorbox({
28
            inline : true,
29
            width : "400px",
30
            height : "210px",
31
            href : "div#updatePincode",
32
            onClosed : function() {
33
                $("div#updatePincode").hide();
34
            }
35
		});
36
	});
37
});
38
 
39
function addPincode(params) {
40
	$.ajax({
41
		type : "POST",
42
		url : "/Support/pincode!addPincode",
43
		data : params,
44
		success : function(response) {
45
			alert("Pincode added successfully");
46
			$.colorbox.close();
47
		},
48
		error : function(response) {
49
			alert("Error in adding pincode" + response);
50
			$.colorbox.close();
51
		}
52
	});
53
}
54
 
55
function updatePincode(params) {
56
	$.ajax({
57
		type : "POST",
58
		url : "/Support/pincode!updatePincode",
59
		data : params,
60
		success : function(response) {
61
			alert("Pincode updated successfully");
62
			$.colorbox.close();
63
		},
64
		error : function(response) {
65
			alert("Error while updating pincode" + response);
66
			$.colorbox.close();
67
		}
68
	});
69
}