Compare commits
2 Commits
1275c2b4cf
...
51b921673e
| Author | SHA1 | Date |
|---|---|---|
|
|
51b921673e | |
|
|
e04d428307 |
|
|
@ -240,16 +240,28 @@
|
|||
});
|
||||
|
||||
|
||||
$(document).on(
|
||||
'input',
|
||||
'#field-xmet_group_rx',
|
||||
function () {
|
||||
$(document).on('input','#field-xmet_group_rx',function () {
|
||||
|
||||
this.value = this.value.replace(/[^0-9]/g, '');
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
let fields=['field-xmet_rx','field-xmet_sr_rx','field-xmet_trio_rx'];
|
||||
function calculateTotal(){
|
||||
let total=0;
|
||||
fields.forEach((nums)=>{
|
||||
let input=document.getElementById(nums).value;
|
||||
total += parseInt(input) ||0;
|
||||
document.getElementById('field-total_xmet_rx').value=total;
|
||||
})
|
||||
console.log("Total is : ",total);
|
||||
}
|
||||
|
||||
fields.forEach((id)=>{
|
||||
document.getElementById(id).addEventListener('input',calculateTotal);
|
||||
})
|
||||
|
||||
|
||||
$(document).on('change', '#field-contact_id', function () {
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue