Skip to content

Instantly share code, notes, and snippets.

@AdriC1705
Created August 14, 2020 17:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AdriC1705/1ffaad01486739b065367dc475b57407 to your computer and use it in GitHub Desktop.
Save AdriC1705/1ffaad01486739b065367dc475b57407 to your computer and use it in GitHub Desktop.
$("#createform").on('submit',function (event){
// checar las validaciones de los campos
var name = $("#name").val();
var last_name = $("#last_name").val();
var email = $("#email").val();
var password = $("#password").val();
$.ajax({
url: 'crear-usuarios',
method: 'post',
data: {
"name": name,
"last_name" : last_name,
"email" : email,
"pass" : password,
},
dataType:'JSON',
success: function(info){
if(info.Code != 200)
{
alert(info.Message);
return false;
}else{
// cerramos el modal
$("#addPuesto .close").click();
window.location.reload();
}
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment