mam wielki problem i nie mogę go rozwiązać od dłuższego czasu :/
Otóż mam sobie taki kod:
<form action="#" method="post"> <div id="box"> <div class="smallBox"> <input type="text" name="fBL[0091]" id="fBL_0091" value="0" /> <input type="text" name="fBL[0092]" id="fBL_0092" value="0" /> <input type="text" name="fBL[0093]" id="fBL_0093" value="0" /> <input type="text" name="fBL_res" id="fBL_res" value="0" /> </div> <div class="smallBox"> <input type="text" name="fBR[0801]" id="fBR_0801" value="0" /> <input type="text" name="fBR[0802]" id="fBR_0802" value="0" /> <input type="text" name="fBR[0804]" id="fBR_0804" value="0" /> <select name="fBR[0804]" id="fBR_0804"> </select> <select name="fBR[0805]" id="fBR_0805"> </select> <input type="text" name="fBR_res" id="fBR_res" value="0" /> </div> </div> <input type="text" name="result" id="result" value="0" /> </form>
Moje pytanie brzmi, jak powinna wyglądać funkcja w mootoolsie, która by obliczała sumę dla wartości dla każdego smallBoxa i wpisywała do fXX_res oraz sumę wszystkich fXX_res i wpisywałą do inputa o id #result ?