Hallo, ich hatte vor kurzen noch folgende HTML Struktur in einem nachgeladenen Formular
Dort funktionierte folgender Funktionsaufruf:
Jetzt habe im HTM um das input select noch ein div gelegt. Nun funktioniert mein Code aber nicht mehr. Woran kann das liegen?
Gruß Patrick
HTML:
<div id="crafter-form">
<div id="form-1" class="formular display">
<div class="input select">
<label for="rechenpaket-0-arten">Rechenoperation</label>
<input type="hidden" name="rechenpaket[0][arten]" value="">
<div class="checkbox">
<label for="rechenpaket-0-arten-addition">
<input type="checkbox" name="rechenpaket[0][arten][]" value="addition" id="rechenpaket-0-arten">Addition
< /label>
</div>
<div class="checkbox">
<label for="rechenpaket-0-arten-subtraktion">
<input type="checkbox" name="rechenpaket[0][arten][]" value="subtraktion" id="rechenpaket-0-arten">Subtraktion
</label>
</div>
</div>
<button id="rechenpaket-1-update" class="update-rechenpaket">Aktualisieren</button>
</div>
<div>
Dort funktionierte folgender Funktionsaufruf:
Code:
$( '#crafter-form' ).on('click','.update-rechenpaket',function(){
if($('#rechenpaket-0-arten-addition:checked').val()){
arten.push ('+');
}
});
Gruß Patrick