photo remaining
This commit is contained in:
@ -243,7 +243,7 @@ button:hover {
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form method=POST action="" enctype="multipart/form-data" name="tbl_accounts">
|
||||
<form id="myForm" method=POST action="" enctype="multipart/form-data" name="tbl_accounts">
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="row">
|
||||
@ -301,7 +301,7 @@ button:hover {
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">Close</button>
|
||||
|
||||
<button class="btn btn-primary btn-sm" type="submit" name="submit">Save</button>
|
||||
<button class="btn btn-primary btn-sm" type="submit" name="action" value="saveacc">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@ -333,6 +333,31 @@ button:hover {
|
||||
</script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#myForm').submit(function(event) {
|
||||
// event.preventDefault();
|
||||
|
||||
var formData = new FormData(this);
|
||||
|
||||
$.ajax({
|
||||
url: '<?php echo site_url("accounts/Vouchers/saveaccount/"); ?>',
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
alert("saved");
|
||||
$('#exampleModal').modal('hide');
|
||||
$('#myForm')[0].reset();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.log(error);
|
||||
alert("Error submitting form.");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#posting_side_selector").change(function(e) {
|
||||
var posting_side = $("#posting_side_selector").val();
|
||||
if (posting_side == "debit") {
|
||||
@ -410,8 +435,8 @@ button:hover {
|
||||
} else {
|
||||
msg = "Account Head Not Selected!";
|
||||
}
|
||||
$("#account_id_cr").val() = 0;
|
||||
$("#account_id_dr").val() = 0;
|
||||
$("#account_id_cr").val('').trigger('change');
|
||||
$("#account_id_dr").val('').trigger('change');
|
||||
$("#errorBox h5").html(msg);
|
||||
$("#errorBox").fadeTo(2000, 500).slideUp(500, function() {
|
||||
$("#errorBox").slideUp(500);
|
||||
|
Reference in New Issue
Block a user