skip to Main Content

How to make specific input readonly and take value (0.00) when a specific value exists in another input using jQuery

$(document).on('change keyup', '.debtor , .creditor', function() { //get amt and qty value var debtor = $(this).closest('tr').find('.debtor').val(); var creditor = $(this).closest('tr').find('.creditor').val(); if (debtor > 0) { $(this).closest('tr').find('.creditor').val(0).css("pointer-events", "none", "cursor", "not-allowed"); } else {} if (creditor > 0) { $(this).closest('tr').find('.debtor').val(0).css("pointer-events", "none", "cursor",…

VIEW QUESTION

Loop on html objects and obtain a single array of objects – Jquery

I have some html objects like: <input id="myfield1" class="fields_to_iterate"> <input id="myfield2" class="fields_to_iterate"> <input id="myfield3" class="fields_to_iterate"> <input id="myfield4" class="fields_to_iterate"> <input id="myfield5" class="fields_to_iterate"> and if I do in javascript: $('.fields_to_iterate').each( (index, element) => { myObject.push( { [$(element).attr('id')] : $(element).val() } ); });…

VIEW QUESTION
Back To Top
Search