Всем, доброе время суток.
Просьба помочь.
Есть html код:
<form class="webform4" id="webform-4">
<input required="required" type="radio" id="edit-submitted-2-1" name="submitted[2]" value="a" class="form-radio">
<input required="required" type="radio" id="edit-submitted-2-2" name="submitted[2]" value="ab" class="form-radio">
<input required="required" type="radio" id="edit-submitted-2-3" name="submitted[2]" value="ba" class="form-radio">
<input required="required" type="radio" id="edit-submitted-2-4" name="submitted[2]" value="b" class="form-radio">
<input class="form-control form-text" type="text" id="edit-submitted-2a" name="submitted[2a]" value="" size="60" maxlength="128">
<input class="form-control form-text" type="text" id="edit-submitted-2b" name="submitted[2b]" value="" size="60" maxlength="128">
<input required="required" type="radio" id="edit-submitted-3-1" name="submitted[3]" value="a" class="form-radio">
<input required="required" type="radio" id="edit-submitted-3-2" name="submitted[3]" value="ab" class="form-radio">
<input required="required" type="radio" id="edit-submitted-3-3" name="submitted[3]" value="ba" class="form-radio">
<input required="required" type="radio" id="edit-submitted-3-4" name="submitted[3]" value="b" class="form-radio">
<input class="form-control form-text" type="text" id="edit-submitted-3a" name="submitted[3a]" value="" size="60" maxlength="128">
<input class="form-control form-text" type="text" id="edit-submitted-3b" name="submitted[3b]" value="" size="60" maxlength="128">
.....
<input required="required" type="radio" id="edit-submitted-n-1" name="submitted[n]" value="a" class="form-radio">
<input required="required" type="radio" id="edit-submitted-n-2" name="submitted[n]" value="ab" class="form-radio">
<input required="required" type="radio" id="edit-submitted-n-3" name="submitted[n]" value="ba" class="form-radio">
<input required="required" type="radio" id="edit-submitted-n-4" name="submitted[n]" value="b" class="form-radio">
<input class="form-control form-text" type="text" id="edit-submitted-na" name="submitted[na]" value="" size="60" maxlength="128">
<input class="form-control form-text" type="text" id="edit-submitted-nb" name="submitted[nb]" value="" size="60" maxlength="128">
</form>
Нужно, чтоб при выборе, к примеру (name="submitted[2]" value="a") в (name="submitted[2a]") заполнялось 10 а в (name="submitted[2b]") заполнялось 40.
Если выбран (name="submitted[2]" value="ab") то в (submitted[2a] и submitted[2b]) 20 и 30 соответственно.
Если выбран (name="submitted[2]" value="ba") то в (submitted[2a] и submitted[2b]) 50 и 80 соответственно.
Если выбран (name="submitted[2]" value="b") то в (submitted[2a] и submitted[2b]) 70 и 60 соответственно.
И так со всеми радиокнопками, при выборе name=submitted[1...до n] заполнялись поля name=submitted[1a...до na] и name=submitted[1b...до nb]