javascript - Uncaught ReferenceError: y is not defined -


it seems not checkboxes being checked saved values. looks overlooked item.appointmenttype[1] array of values , checkboxes[i].value string, , if statement never true. think nested loop necessary loop through item.appointmenttype[1]. should able use if statement compare checkboxes[i].value item.appointmentvalue[1][y] example. however, i'm not sure if code have written correct. can me rewrite work rest of code?

var checkboxes = document.forms[0].appointmenttype; for(var i=0; i<checkboxes.length; i++){     if(checkboxes[i].value === item.appointmenttype[1]){     checkboxes[i].setattribute("checked", "checked");     }     for(var ii=0; ii<item.appointmenttype.length; ii++){     if(checkboxes[i].value === item.appointmenttype[1][y]){         checkboxes[y].setattribute("checked", "checked");     }     } } 


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -