спокойной ночи. У меня есть эта функция, но я не знаю, как разделить ввод одного значения с другим вводом? Мне нужно разделить входные данные с NumberroCuotassinquita, а также pHonorar ios с NumeroCuotassinquita. Кто-то сделал это для меня, но я не понимаю, как это работает. всякий раз, когда я изменяю значение NumberroCuotossinquita, оно не меняет остальное ... даже если я изменяю вход pHonorariossinquita, я должен go вернуться к первому значению и удалить его, записать число и все тот же
<div class="container">
<div class="row">
<div class="col-6 mx-auto">
<div class="card shadow bg-light rounded mt-2 mx-auto">
<h5 class="card-header text-white bg-dark">CALCULADOR DE CUOTAS SIN QUITA</h5>
<form class="needs-validation" novalidate id="sinquita_form" autocomplete="off">
<div class="card-body">
<div class="form-row mb-2">
<label for="deudaTotalsinquita" class="col-5 col-form-label col-form-label-sm">Deuda Total</label>
<div class="col-7">
<div class="form-row input-group input-group-sm">
<div class="input-group-prepend">
<div class="input-group-text"><strong>$</strong></div>
</div>
<!-- aqui-->
<input class="form-control form-control-sm" type="number" name="deudaTotalsinquita" id="deudaTotalsinquita" min="1" step="0.001" placeholder="Deuda Total" required>
<div class="invalid-tooltip">
Ingrese el saldo deudor.
</div>
</div>
</div>
</div>
<div class="form-row mb-2">
<label for="numeroCuotassinquita" class="col-5 col-form-label col-form-label-sm">Cantidad de Cuotas</label>
<div class="col-7">
<div class="form-row input-group input-group-sm">
<div class="input-group-prepend">
<div class="input-group-text"><strong>N°</strong></div>
</div>
<select class="custom-select custom-select-sm" name="numeroCuotas" id="numeroCuotassinquita" required>
<option value="1">1 Cuota</option>
<option value="2">2 Cuotas</option>
</select>
<div class="invalid-tooltip">
Ingrese las cuotas.
</div>
</div>
</div>
</div>
<div class="form-row mb-2">
<label for="importeCuotassinquita" class="col-5 col-form-label col-form-label-sm">Importe Cuotas</label>
<div class="col-7">
<div class="form-row input-group input-group-sm">
<div class="input-group-prepend">
<div class="input-group-text"><strong>$</strong></div>
</div>
<input class="form-control form-control-sm bg-info text-white not-allowed" tabIndex="-1" type="number" name="importeCuotassinquita" id="importeCuotassinquita" readonly>
</div>
</div>
</div>
<div class="form-row mb-2">
<label for="pHonorariossinquita" class="col-5 col-form-label col-form-label-sm">Porcentaje Honorarios</label>
<div class="col-7">
<div class="form-row input-group input-group-sm">
<div class="input-group-prepend">
<div class="input-group-text"><strong>%</strong></div>
</div>
<input class="form-control form-control-sm" type="number" name="pHonorariossinquita" id="pHonorariossinquita" min="15" max="100" step="1" value="18" required>
<div class="invalid-tooltip">
Ingrese el porcentaje de honorarios.
</div>
</div>
</div>
</div>
<div class="form-row mb-2">
<label for="honorariossinquita" class="col-5 col-form-label col-form-label-sm">Total Honorarios</label>
<div class="col-7">
<div class="form-row input-group input-group-sm">
<div class="input-group-prepend">
<div class="input-group-text"><strong>$</strong></div>
</div>
<input class="form-control form-control-sm bg-info text-white not-allowed" tabIndex="-1" type="number" name="honorariossinquita" id="honorariossinquita" readonly>
</div>
</div>
</div>
<div class="form-row mb-2">
<label for="cuotaHonorariossinquita" class="col-5 col-form-label col-form-label-sm">Cuota Honorarios</label>
<div class="col-7">
<div class="form-row input-group input-group-sm">
<div class="input-group-prepend">
<div class="input-group-text"><strong>$</strong></div>
</div>
<input class="form-control form-control-sm bg-info text-white not-allowed" tabIndex="-1" type="number" name="cuotaHonorariossinquita" id="cuotaHonorariossinquita" readonly>
</div>
</div>
</div>
<div class="form-row mb-2">
<label for="totalFinalsinquita" class="col-5 col-form-label col-form-label-sm">Total Deuda y Honorarios</label>
<div class="col-7">
<div class="form-row input-group input-group-sm">
<div class="input-group-prepend">
<div class="input-group-text"><strong>$</strong></div>
</div>
<input class="form-control form-control-sm bg-info text-white not-allowed" tabIndex="-1" type="number" name="totalFinalsinquita" id="totalFinalsinquita" readonly>
</div>
</div>
</div>
<div class="alert alert-primary mt-4 mb-2" id="resumensinquita"></div>
</div>
<div class="card-footer text-muted">
<button type="button" class="btn btn-primary" name="calcular" id="calcularsinquita">Calcular</button>
<button type="button" class="btn btn-warning" name="copiar" id="copiarsinquita">Copiar</button>
<button type="button" class="btn btn-secondary" name="borrar" id="borrarsinquita">Borrar</button>
</div>
</form>
</div>
</div>
</div>
</div>
$('#deudaTotalsinquita').on('keyup', function(e) {
// this
let self = $(this);
// buscamos a unos de los padres
let parent = self.parents("div .card-body");
// el simbolo + al principio hace un cast a int automatico
// buscamos los input que nos interesan
// seleccionamos por el name "selectores avanzados de css"
let input = +self.val();
let pHonorarios = +parent.find('.mb-2 input[name="pHonorariossinquita"]').val();
let selected = +parent.find('select[name="numeroCuotassinquita"]').val();
// input a cambiar los valores
let importeCuotassinquita = parent.find('.mb-2 input[name="importeCuotassinquita"]');
let honorariossinquita = parent.find('.mb-2 input[name="honorariossinquita"]');
let cuotaHonorariossinquita = parent.find('.mb-2 input[name="cuotaHonorariossinquita"]');
let totalFinalsinquita = parent.find('.mb-2 input[name="totalFinalsinquita"]');
// test
// aqui ya haces tus formulas
importeCuotassinquita.val(input /numeroCuotassinquita );
honorariossinquita.val(input * ("0."+pHonorarios ));
cuotaHonorariossinquita.val(input);
totalFinalsinquita.val(input * ("1."+pHonorarios ));
});