NBS Posted October 8, 2008 Report Share Posted October 8, 2008 Ir tāda lieta, ka vēlos cikliski piešķirt mainīgajam check = "check1", "check2", "check3", "check4" utt. Bet šim JS skriptam nepatīk, ka es šādi veidoju: var check = document.getElementById("check"+ i); function check() { var count = '<%= count %>'; for (i = 0; i <= count; i++) { var check = document.getElementById("check"+ i); if (check.selected) { alert("Neatstājiet tukšus laukus!"); return false; break; } } return true; } Izpalīdziet, lūdzu. Link to comment Share on other sites More sharing options...
bubu Posted October 8, 2008 Report Share Posted October 8, 2008 Ko nozīmē "JS skriptam nepatīk" ? Link to comment Share on other sites More sharing options...
andrisp Posted October 8, 2008 Report Share Posted October 8, 2008 Kāda kļūda rādas ? Link to comment Share on other sites More sharing options...
NBS Posted October 8, 2008 Author Report Share Posted October 8, 2008 Šajā rindā kļūda, illegal literal in statement... var check = document.getElementById("check"+ i); Link to comment Share on other sites More sharing options...
bubu Posted October 8, 2008 Report Share Posted October 8, 2008 Tur ir kautkur citur problēma. Tai rindai nav ne vainas. btw pēc return steitmenta nekāds kods neizpildās (tavs break). Link to comment Share on other sites More sharing options...
NBS Posted October 8, 2008 Author Report Share Posted October 8, 2008 Okey, meklēšu VBscriptā kļūdu. Teorētiski sanāk: break; return false; ? Link to comment Share on other sites More sharing options...
andrisp Posted October 8, 2008 Report Share Posted October 8, 2008 Tas break tur vispār nav vajadzīgs. Link to comment Share on other sites More sharing options...
NBS Posted October 8, 2008 Author Report Share Posted October 8, 2008 Skaidrs, paldies. Link to comment Share on other sites More sharing options...
Recommended Posts