Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('#basic_validate').submit(function(e) {
- document.getElementById('successmsg').style.display = 'none';
- document.getElementById('errormsg').style.display = 'none';
- e.preventDefault();
- $.ajax({
- type: "POST",
- url: "../suppliers/resources/controllers/register.php",
- async: true,
- data: $(this).serialize(),
- success: function(data) {
- },
- complete: function(result){
- if(result == true){
- //clear inputs
- document.getElementById('successmsg').style.display = 'block';
- }else{
- document.getElementById('errormsg').style.display = 'block';
- }
- }
- });
- });
- <form class="form-horizontal" method="post" name="frmLogin" id="frmLogin">
- //text_inputs
- $('#frmLogin').submit(function(e) {
- e.preventDefault(); // <------------
- $.ajax({
- type: "POST",
- url: "../controllers/insert.php",
- async: true,
- data: $(this).serialize(),
- success: function(data) {
- },
- complete: function(result){
- if(result == 10)
- //clear inputs
- //show msg success
- else
- //show msg error
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement