NBS Posted June 28, 2008 Report Share Posted June 28, 2008 Sveiki, man ir tāda lieta, ka es vēlētos izveidot funkciju, kas izlaižs caur ciklu cik daudz checkbox checked un visus šos checkboxus, kas ir atzīmēti nosūta, visus pēc ID uz print.php?=$id. Izveidoju kaut ko šādu: function checkbox(form) { var url = "print.php"; var visi = 0; var max = form.checkbox.length; for (var idx = 0; idx < max; idx++) { if (eval("document.form[" + idx + "].checked") == true) { visi += 1; } } alert("Atzimeti " + visi "); } Link to comment Share on other sites More sharing options...
marcis Posted June 28, 2008 Report Share Posted June 28, 2008 function checkbox(what){ var visi = ""; var max = what.elements.length; for (idx=0;idx<max;idx++){ if(what.elements[idx].type=="checkbox" && what.elements[idx].checked==true){ visi+=what.elements[idx].value+","; } } alert("Atzimeti: "+visi); } Link to comment Share on other sites More sharing options...
NBS Posted July 1, 2008 Author Report Share Posted July 1, 2008 Paldies. Link to comment Share on other sites More sharing options...
Recommended Posts