Code: Select all
To pay , select the policy from the list and click Proceed.
Policy Number
Description
Status
Current Premium
Amount Outstanding
Collection Day
12345678
Income Protection Plan
In Force
€1,574.40
Annual
€1,574.40
15
98765432
Income Protection Plan
In Force
€841.01
Annual
€841.01
23
Code: Select all
jQuery(document).ready(function () {
'use strict';
jQuery('input:radio[name="agreeToMandate"]').prop('checked', false);
jQuery('input:checkbox[name^="paymentList"]').on('change', function () {
var selected = [];
jQuery.each(jQuery('input[name^="paymentList"]:checked'), function(){
selected.push(jQuery(this).attr('id'));
});
if(selected.length>0) {
var total = getTotalAmount(selected);
jQuery('#fldTotal_Amount').text(total);
jQuery('#divSubmit').css('display', 'block');
}else {
jQuery('#divSubmit').css('display', 'none');
}
});
jQuery('#paymentForm').submit(function (event) {
if (!jQuery('input:checkbox[name^="paymentList"]:checked').val()) {
showValidationError('Contract','Please select a contract');
return false;
}
return true;
});
jQuery('#btnCancel').click(function () {
window.location.href = 'list_payment.form';
return false;
});
});
function getTotalAmount(selected) {
var total = 0;
for (var index = 0; index < selected.length; index++) {
var contractNumber = selected[index].substr(11);
var selId = '#txtAmount' + contractNumber;
var currency = jQuery(selId).text().trim();
var value = Number(currency.replace(/[^0-9\.]+/g,""));
total += parseFloat(value);
}
return total.toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,');
}
function toggleField(field){
if (jQuery(field).prop('checked')){
jQuery(field).prop('unchecked');
}else{
jQuery(field).prop('checked');
}
}
Code: Select all
Wenn ich die Eingabe in und diesen Abschnitt von payment.js wie folgt:
Code: Select all
jQuery('input:button[name^="paymentList"]').click(function () {
var selected = [];
selected.push(jQuery(this).attr('id'));
if(selected.length>0) {
var total = getTotalAmount(selected);
jQuery('#fldTotal_Amount').text(total);
jQuery('#divSubmit').css('display', 'block');
}else {
jQuery('#divSubmit').css('display', 'none');
}
});
jQuery('#paymentForm').submit(function (event) {
return true;
});
Mobile version