Hello i am trying to add up two input fields that are not inserted with keyboard. But are just disabled input fields. If i choose dates the input field will generate a price function setFullPrice()
, and the other input field gets generated from checking a checkbox with a price if($('#electricityCheckbox').is(':checked'))
. But how do i sum up the 2 input fields and output in #totalPrice
.
I tried to do it with code online but i saw only explanations to sum up fields that you fill in, that's not the case with me.
function setFullPrice() {
if(getDays() > 0) {
$('#overNightRate').val(getDays() * 200);
}
}
if($('#electricityCheckbox').is(':checked')) {
$('#extraPrice').val(10 + ' euro');
}
<input id='overNightRate' type='text' name='overNightRate' class='form-control addUpFields' placeholder="Bedrag word berekent" disabled/>
<input id='extraPrice' type='text' name='extraPrice' class='form-control addUpFields' placeholder="Bedrag word berekent" disabled/>
<input id='totalPrice' type='text' name='totalPrice' class='form-control' placeholder="Bedrag word berekent" disabled/>
I appreciate your time, thanks (i am beginner in Jquery sorry for if this is a stupid question).