Ok, perfetto... con alert funziona.
Pero, ovviamente, a me serve altro, ovvero:
Però l'alert (inserito per verificare) adesso mi restituisce undefined; a me serve poter identificare lo specifico selettore (tra i 4 con class="selcalc") su cui ha agito l'utente... però evidentementecodice:$(document).bind('change', '.selcalc', test)function test(){ var item = $(this).attr('id'); alert(item); if (item == "cat") { var per = parseInt(3); } else if (item == "loc" || item == "map") { var per = parseInt(10); } else if (item == "web") { var per = parseInt(15); } var molt = parseInt($(".selcalc option:selected").each()); var tot = parseInt($("#due").val()); var newtot = (per*molt)+tot; $("#due").val(newtot); var newsumm = "Total: € "+newtot+".00"; $("#amount").html(newsumm); }non rileva l'attributo...codice:var item = $(this).attr('id');
Credo che anche questo sia collegato al fatto che gli elementi sono creati dinamicamente. E probabilmente la stessa cosa vale per la funzione remove(), con la quale provo ad eliminarli se necessario, ma che a sua volta non funziona.
Dov'è l'inghippo?

Rispondi quotando