Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="modal fade" id="errorAlert" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
- <div class="modal-dialog" role="document">
- <div class="modal-content">
- <div class="modal-body">
- <center><?php //echo $this->session->flashdata('hasil'); ?></center>
- </div>
- <div class="modal-footer">
- <a href="" style="cursor: pointer;">
- <button class="btn btn-primary-learn" data-dismiss="modal" style=";text-transform: capitalize;color: #fff;cursor: pointer;">Tutup</button>
- </a>
- </div>
- </div>
- </div>
- </div>
- <script>
- $(function () {
- $('form').on('submit', function (e) {
- e.preventDefault();
- $.ajax({
- type: 'POST',
- url: '<?php echo base_url() ?>Profil/perusahaan_added',
- data: $('form').serialize(),
- success: function (data) {
- //alert('form was submitted');
- data = $.parseJSON(data); // parse text to json object
- console.log(data);
- if (data.loginStatus) { // check if loginStatus is true
- window.location.href = data.redirectUrl
- } else { // else show the error message
- // $('#errorAlert').modal('show');
- // setTimeout(function () {
- // $('#errorAlert').fadeOut("slow");
- // }, 2000);
- //alert('gagal');
- $('#errorAlert').modal('show');
- }
- },
- error : function(xhr) {
- // if(xhr.status==404){
- // alert("404");
- // }else if(xhr.status==400){
- // alert("400");
- // }else{
- // alert("error lain");
- // }
- alert('gagal2');
- }
- });
- });
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement