MERGE_TEST_MINOR_ISSUES
This commit is contained in:
commit
7d0d1b073f
@ -21,6 +21,11 @@
|
||||
.is-invalid {
|
||||
border-color: #dc3545 !important;
|
||||
}
|
||||
|
||||
/* Avoid duplicate validation messages: keep custom .field-error only */
|
||||
#insurer_branch_form .parsley-errors-list {
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
<!-- Optional CSS -->
|
||||
<style>
|
||||
@ -495,8 +500,15 @@
|
||||
}
|
||||
|
||||
function getErrorElement($field) {
|
||||
var $next = $field.next('.field-error');
|
||||
if ($next.length) return $next;
|
||||
var $group = $field.closest('.form-group');
|
||||
var $existing = $group.find('.field-error');
|
||||
|
||||
if ($existing.length) {
|
||||
if ($existing.length > 1) {
|
||||
$existing.slice(1).remove();
|
||||
}
|
||||
return $existing.first();
|
||||
}
|
||||
|
||||
var $error = $('<small class="field-error"></small>');
|
||||
$field.after($error);
|
||||
@ -739,12 +751,18 @@
|
||||
success: function(res) {
|
||||
$("#insurer_branch_form")[0].reset();
|
||||
console.log(res);
|
||||
if (res && res.status) {
|
||||
toastr.success(res.message || 'Insurer branch saved successfully', 'Success');
|
||||
window.location.reload();
|
||||
return;
|
||||
}
|
||||
|
||||
$('#insurer_branch_list tr').remove();
|
||||
renderBranchRows(res.data || []);
|
||||
initBranchDataTable();
|
||||
$('#container').empty(); $('#contact_1_wrapper input').val('');
|
||||
hideBranchModal();
|
||||
// window.location.reload();
|
||||
toastr.warning((res && res.message) ? res.message : 'Unable to save insurer branch', 'Warning');
|
||||
// $('#add_branch').hide();
|
||||
// $('#branch_table').show();
|
||||
// $('.btnBack').hide();
|
||||
|
||||
@ -170,10 +170,12 @@ $rto_col_width_px = nhance_dt_column_widths_px($rto_header_labels, $rto_col_max_
|
||||
placeholder="Enter RTO State" style="text-transform:uppercase"
|
||||
required
|
||||
data-parsley-required-message="RTO State is required"
|
||||
data-parsley-type="alpha"
|
||||
data-parsley-type-message="RTO State must contain only alphabets"
|
||||
data-parsley-length="[2,2]"
|
||||
data-parsley-length-message="RTO State must be exactly 2 letters"
|
||||
data-parsley-pattern="^[a-zA-Z\s]+$"
|
||||
data-parsley-pattern-message="RTO State must contain only alphabets and spaces"
|
||||
data-parsley-minlength="2"
|
||||
data-parsley-minlength-message="RTO State must be at least 2 characters"
|
||||
data-parsley-maxlength="50"
|
||||
data-parsley-maxlength-message="RTO State maximum 50 characters"
|
||||
data-parsley-trigger="keyup">
|
||||
</div>
|
||||
|
||||
@ -289,7 +291,7 @@ $rto_col_width_px = nhance_dt_column_widths_px($rto_header_labels, $rto_col_max_
|
||||
} else if (type == 'edit'){
|
||||
method = "GET";
|
||||
$('#modalLabel').text('Edit RTO details');
|
||||
$('#vehicleTypeForm')[0].reset();
|
||||
$('#RTOForm')[0].reset();
|
||||
}
|
||||
|
||||
console.log("type", type)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user