All Downloads are FREE. Search and download functionalities are using the official Maven repository.

static.js.admin.users.edit.js Maven / Gradle / Ivy

There is a newer version: 0.6.1
Show newest version
function saveUser(sel, url, successcallback) {

	var data = sel.serialize();
	
	$.ajax({
		type : 'POST',
		url  : url + "?" + data,
		contentType: 'application/json; charset=utf-8',
		dataType    : 'json',		
		success :  function(data) {
			
			hidemessages();
			showsuccess(sel, "User Saved");
			typeof successcallback === 'function' && successcallback(data);
		},
		error: function (data) {
			hidemessages();
			var text = JSON.parse(data.responseText)
			showerror(sel, "Unable to Save - " + text.message);
		}
	});
}

$(document).ready(function() {
	
	$(".saveuser").submit(function(event) {
		saveUser($(this), "/api/users/save");
		return false;
	});
});




© 2015 - 2024 Weber Informatics LLC | Privacy Policy