I have a multiple table rows and in each row is one checkbox. When I click Submit I need to recognize which one are checked.
So I will go through one loop and examine all checkboxes.
The problem is how to get the name of checkbox because name of my checkboxes are check1,check2,check3,....,checkn
So I need something like this in my loop...
for ($i = 1; $i < $tableSize; $i++) {
if ( isset( $("check".$i) ) ) { // IS THIS GOOD?
//then it is checked
}
else {
//than it is not checked
}
}
Question:
How to recognize element with dynamic name?
Is it good $("check".$i) where $i is loop counter and
my valid element names are check1,check2,check3...?