This commit is contained in:
venkateswaran ubuntu 2023-09-04 10:20:41 +05:30
parent b5272c3a21
commit a2f122b8d0

View File

@ -193,7 +193,7 @@ $(document).on('click','.manage-credits',function(){
</div>
<div id="count_hide_show" class="mb-1 mt-2"></div>
<div class="mb-1 mt-2 col-md-4">
<label class="form-label">Credit<span style="color: red;margin-left: 4px;">*</label>
<label class="form-label">Credit Points<span style="color: red;margin-left: 4px;">*</label>
<input type="number" class="form-control" min="1" name="credit_points" id="credit" required value="1" onkeypress = "return matchnum(event)">
</div>
<div class="mb-1 mt-2 col-md-4">
@ -382,6 +382,7 @@ function matchnum(event)
$(document).on('change','.add_or_sub',function(){
var selectedValue = $('input[name="add_or_sub"]:checked').val();
if (selectedValue === 'sub') {
$("#packs").val(""); // Clear the Pack select
$("#packs").val("CreditPoints");
$('#method option[value="card"]').hide();
$('#method option[value="cash"]').hide();
@ -389,7 +390,13 @@ $(document).on('change','.add_or_sub',function(){
$("#packs option[value='7']").hide();
$('#count_hide_show').hide();
$('#remarks').prop('required', true);
$("#credit").val("1"); // Reset Credit to 1 (you can set it to any default value)
$("#cost").val("");
$('#credit').prop('readonly', false);
$('.changeClass').removeClass('col-md-8').addClass('col-md-12');
} else {
$("#packs").val("CreditPoints");
$('#count_hide_show').hide();
$('#method option[value="card"]').show();
$('#method option[value="cash"]').show();
$("#packs option[value='6']").show();