mardi 13 septembre 2016

according to clicked checkbox I want the value between fixed 1 to 10

Hear there are 10 images named 1.jpg .... to 10.jpg , And when I clicked on checkbox I want the value of 1 to 10 , If I clicked 3rd checkbox I'll get 3 , if clicked 5 then 5 ....

for(int i = 1 ; i <=10 ; i++)
{
 int temp_i = i;
 out.println(temp_i);
 out.println(" <input type='checkbox' id='"+temp_i+"' value='"+temp_i+"'      onchange='ImageChkId()' >");
 out.println("<img src='Image/"+i+".jpg' id='img1to10'             style=width:150px;height:150px > ");
}




Aucun commentaire:

Enregistrer un commentaire