Subversion Repositories SmartDukaan

Rev

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

Rev 20906 Rev 20907
Line 1... Line -...
1
function getFormObj(formId) {
-
 
2
    var formObj = {};
-
 
3
    var inputs = $('#'+formId).serializeArray();
-
 
4
    $.each(inputs, function (i, input) {
-
 
5
        formObj[input.name] = input.value;
-
 
6
    });
-
 
7
    return formObj;
-
 
8
}
-
 
9
$(function() {
1
$(function() {
10
	$('#add-nonserialized-return').live('click', function(){
2
	$('#add-nonserialized-return').live('click', function(){
11
		$('<br/><label>ItemId : </label><input class = "return-itemId" name = "returnItemId" type = "textbox"/>'
3
		$('<br/><label>ItemId : </label><input class = "return-itemId" name = "returnItemId" type = "textbox"/>'
12
				+'<label>Quantity : </label><input class = "return-qty" name = "returnQty" type = "textbox"/>').appendTo('#nonserialized-items-container');
4
				+'<label>Quantity : </label><input class = "return-qty" name = "returnQty" type = "textbox"/>').appendTo('#nonserialized-items-container');
13
	});
5
	});
Line 146... Line 138...
146
	$('#create-purchase-return').live('submit', function() {
138
	$('#create-purchase-return').live('submit', function() {
147
		$('#campaignListUpdate1').val('-1');
139
		$('#campaignListUpdate1').val('-1');
148
		var data = new FormData();
140
		var data = new FormData();
149
		var inputs = $(this).serializeArray();
141
		var inputs = $(this).serializeArray();
150
		$.each(inputs, function (i, input) {
142
		$.each(inputs, function (i, input) {
151
			if(typeof input.files !=undefined){
143
			if(typeof input.files != 'undefined'){
152
				data.append('file', input.files[0]);
144
				data.append('file', input.files[0]);
153
			} else {
145
			} else {
154
	        	data.append(input.name,input.value);
146
	        	data.append(input.name,input.value);
155
			}
147
			}
156
	    });
148
	    });