(07-22-2017, 09:16 AM)Junie Wrote: (07-22-2017, 09:06 AM)Paradinight Wrote: 1.
<button type="submit" id="btnSave" onclick="save()" class="btn btn-effect"><i class="fa fa-plus-circle" aria-hidden="true"></i> proceed...</button> <- type="button"
2. save_method <- has no value and because of the empty value url is empty too
Sir,
In the save function, the if else condition for save_method is equals to 'add' and there's also a value for the url. Its just I remove this function upon calling the modal for adding method. Originally this CRUD operation is made uing MODAL and I want to create a one-page crud without the modal.
Code:
function add_agency() {
save_method = 'add';
$('#agencyForm')[0].reset();
$('.form-group').removeClass('has-error');
$('.help-block').empty();
$('#modal_form').modal('show');
$('.modal-title').text('Add Agency');
}
i need the real code. the code you showed to me is wrong.
Code:
var save_method; //for save method string
...
if (save_method == 'add') {
url = "<?php echo site_url('agency/addAgency')?>";
} else {
// url = "<?php echo site_url('agency/update_update')?>";
}
save_method has not the value of add.