I am trying to submit two value using java script code. its work fine when both fields are text input fields. But when one of those field is drop down list, then its not calculating. Below is my code for both java script and html
city[] is depdent drop down list field which i want to multiply with qty and want to display their sum in discunt
<td><Select class="city form-control text-end" name="city[]" id = "city" required onchange="GetDetail(this.closest('tr'))" >
<option value="">Select Machine</option></select></td>
<td><input type="text" class="qty form-control text-end" name="qty[]" id="ccc" onfocus="Calc(this);" Required></td>
<td><input type="text" class="discunt form-control text-end" name="discunt[]" id="ccc1" onfocus="Calc(this);" Required></td>
here is java script calculation
function Calc(v)
{
/*Detail Calculation Each Row*/
var index = $(v).parent().parent().index();
var qqq1 = document.getElementsByName("qty[]")[index].value;
var rrr1 = document.getElementsByName("city[]")[index].value;
var discunt = +rrr1 - +qqq1
document.getElementsByName("discunt[]")[index].value = discunt;
GetTotal();
}