
static.js.admin.clients.edit.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of formkiq-server Show documentation
Show all versions of formkiq-server Show documentation
Server-side integration for the FormKiQ ios application
function saveClient(sel, url, type) {
var data = sel.serialize();
$.ajax({
type : 'POST',
url : url + "?" + data,
contentType: 'application/json; charset=utf-8',
dataType : 'json',
success : function(data) {
hidemessages();
showsuccess(sel, "Client " + type);
},
error: function (data) {
hidemessages();
var text = JSON.parse(data.responseText)
showerror(sel, "Unable to " + type + " Client - " + text.message);
}
});
}
$(document).ready(function() {
var client = $("#client").val();
$.getJSON("/api/clients/get?client=" + client, function(data) {
$.map(data.granttypes, function (item, index) {
$("#" + item).prop('checked',true);
});
});
$('.clientsave').submit(function(event) {
saveClient($(this), "/api/clients/save", "Save")
return false;
});
$("#generatetokens2").click(function() {
var uuid = guid();
$('#clientsecret2').attr("value", uuid);
});
$("#generatetokens").click(function() {
$('.client').attr("value", guid());
$('#clientsecret').attr("value", guid());
})
});
© 2015 - 2025 Weber Informatics LLC | Privacy Policy