Created
November 30, 2018 09:05
-
-
Save itssomething/1436dc174fc4c56661ede36dfe8e0a8b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
$('#add-nv').on('click', function(){ | |
var username = $('#username').val(); | |
var name = $('#name').val(); | |
var password = $('#password').val(); | |
var email = $('#email').val(); | |
var department = $('#department').val(); | |
var position = $('#position').val(); | |
var status = $('#status').val(); | |
if (username=='' || name=='' || password==''){ | |
alert("Pls fill"); | |
} | |
else{ | |
$.ajax({ | |
url:"insertnv.php", | |
type:"post", | |
data:{ | |
username:username, | |
name:name, | |
password:password, | |
email:email, | |
department:department, | |
position:position, | |
status:status | |
}, | |
success: function(){ | |
$('#username').val(''); | |
$('#name').val(''); | |
$('#password').val(''); | |
$('#email').val(''); | |
$('#department').val(''); | |
$('#position').val(''); | |
$('#status').val(''); | |
$("#table-nv").append(`<tr><td>${username}</td><td>${email}</td></tr>`); | |
} | |
}); | |
} | |
}); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment