Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
23026 ashik.ali 1
$().ready(function() {
2
	$("form#update-retailer-details-form input").each(function(){
3
		$(this).attr('autocomplete', 'off');
4
	});
5
});
6
$().ready(function() {
7
        // validate the comment form when it is submitted
8
		//var shopDetailsSize = $("#shopDetailsSize").attr("size");
9
        $('#update-retailer-details-form').validate({
10
			submitHandler: function (form, event) {
11
				event.preventDefault();
12
				if(validateRetailerDetails()){
13
					alert("Please fix errors");
14
					return false;
15
				}
16
				var json = retailerDetailsJson();
17
				console.log("retailerJson = " + json);
18
				if(confirm("Are you sure you want to update Retailer Details!") == true){
19
		             $.ajax({
20
		                 type: "PUT",
21
		                 url: "retailerDetails",
22
		                 data: json,
23
		                 contentType:'application/json',
24
						async: false,
25
						success: function (data) {
26
							$('#main-content').html(data);
27
						},
28
						cache: false,
29
						processData: false
30
		             });
31
		             return false; // required to block normal submit since you used ajax
32
				}
33
	       }
34
	});
35
 
36
});