master module 2 vadivel J 27-12-2024

This commit is contained in:
vadivelJ96 2024-12-27 11:13:23 +05:30
parent 04afc3f7b8
commit 3aa1a384a4
2 changed files with 17 additions and 22 deletions

View File

@ -199,7 +199,7 @@
</div> </div>
<div class="col-md-12 text-right"> <div class="col-md-12 text-right">
<input type="reset" id="reset" class="btn btn-reset" style="background-color: red;color: white; margin-right: 15px;width: 80px;" value="Reset" /> <input type="reset" id="reset" class="btn btn-reset" style="background-color: red;color: white; margin-right: 15px;width: 80px;" value="Reset" />
<input type="submit" onclick="return Validate();" value="Submit" class="btn btn-success"> <input type="button" id="addSupplierBtnId" value="Submit" class="btn btn-success">
</div> </div>
</div> </div>
</form> </form>
@ -256,9 +256,12 @@
return false; return false;
} }
return true;
} }
$('#supplierName').change(function() { $('#addSupplierBtnId').click(function() {
var supplierName = $('#supplierName').val().trim(); var supplierName = $('#supplierName').val().trim();
var supplierId = $('#SupplierID').val(); var supplierId = $('#SupplierID').val();
@ -289,16 +292,13 @@
$("#supplierName").focus(); $("#supplierName").focus();
} else { } else {
$('#loader').hide(); $('#loader').hide();
//4Debug if (Validate()) {
// alert('This is New Supplier! '); $('#UpdateSupplier').submit();
}
} }
//4Debug
//console.log(data);
}, },
error: function(error) { error: function(error) {
//4Debug
// alert("Error Occur");
$('#loader').hide(); $('#loader').hide();
console.error("Error" , error); console.error("Error" , error);
} }

View File

@ -296,6 +296,7 @@ if (!empty($supplier)) {
<div class="card-body" style="padding: 1rem 2rem !important;"> <div class="card-body" style="padding: 1rem 2rem !important;">
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<form class="form-horizontal" role="form" id="UpdateSupplier" <form class="form-horizontal" role="form" id="UpdateSupplier"
action="<?php echo base_url() ?>editsupplier" method="post" enctype="multipart/form-data"> action="<?php echo base_url() ?>editsupplier" method="post" enctype="multipart/form-data">
<div class="box-body"> <div class="box-body">
@ -530,7 +531,7 @@ if (!empty($supplier)) {
<button type="button" class="btn btn-secondary" onclick="history.back()"> <button type="button" class="btn btn-secondary" onclick="history.back()">
<span class="bold">Cancel</span> <span class="bold">Cancel</span>
</button> </button>
<button type="submit" class="btn btn-info pull-right">Submit</button> <button type="button" id="updateSupplierBtnId" class="btn btn-info pull-right">Submit</button>
</div> </div>
</div> </div>
</div> </div>
@ -560,11 +561,7 @@ if (!empty($supplier)) {
} }
function Validate() { function Validate() {
// if(!validatePAN())
// {
// return false;
// $('#panno').focus();
// }
if ($("#supplierName").val().length < 1) { if ($("#supplierName").val().length < 1) {
alert('Please Enter Supplier Name'); alert('Please Enter Supplier Name');
$("#supplierName").focus(); $("#supplierName").focus();
@ -585,17 +582,12 @@ if (!empty($supplier)) {
return false; return false;
} }
/* return true;
if(!validateGST())
{
$('#GSTNo').focus();
return false;
}*/
} }
//Call to ajax existing PAN //Call to ajax existing PAN
$('#supplierName').change(function () { $('#updateSupplierBtnId').click(function () {
var supplierName = $('#supplierName').val().trim(); var supplierName = $('#supplierName').val().trim();
var supplierId = $('#SupplierID').val(); var supplierId = $('#SupplierID').val();
@ -626,6 +618,9 @@ if (!empty($supplier)) {
$("#supplierName").focus(); $("#supplierName").focus();
} else { } else {
$('#loader').hide(); $('#loader').hide();
if (Validate()) {
$('#UpdateSupplier').submit();
}
} }
}, },