javascript - Get textbox and checkbox value for each row in table -
i've code
<tr class="checkboxrow"> <td class="checkboxcol"> <input name="" type="checkbox" value="7" class="checkbox" /> </td> <td class="checkboxcol"> <input name="" type="checkbox" value="1" class="checkbox" /> </td> <td class="checkboxcol"> <input name="" type="checkbox" value="2" class="checkbox" /> </td> <td class="checkboxcol"> <input name="" type="checkbox" value="3" class="checkbox" /> </td> <td class="checkboxcol"> <input name="" type="checkbox" value="4" class="checkbox" /> </td> <td class="checkboxcol"> <input name="" type="checkbox" value="5" class="checkbox" /> </td> <td class="checkboxcol"> <input name="" type="checkbox" value="6" class="checkbox" /> </td> <td class="fromtimetextboxcol"> <input name="" type="text" class="fromtime" /> </td> <td class="totimetextboxcol"> <input name="" type="text" class="totime" /> </td> </tr> <tr class="checkboxrow"> <td class="checkboxcol"> <input name="" type="checkbox" value="7" class="checkbox" /> </td> <td class="checkboxcol"> <input name="" type="checkbox" value="1" class="checkbox" /> </td> <td class="checkboxcol"> <input name="" type="checkbox" value="2" class="checkbox" /> </td> <td class="checkboxcol"> <input name="" type="checkbox" value="3" class="checkbox" /> </td> <td class="checkboxcol"> <input name="" type="checkbox" value="4" class="checkbox" /> </td> <td class="checkboxcol"> <input name="" type="checkbox" value="5" class="checkbox" /> </td> <td class="checkboxcol"> <input name="" type="checkbox" value="6" class="checkbox" /> </td> <td class="fromtimetextboxcol"> <input name="" type="text" class="fromtime" /> </td> <td class="totimetextboxcol"> <input name="" type="text" class="totime" /> </td> </tr>
now want check each corresponding row atleast 1 checkbox must checked , fromtime
, totime
textbox should have value, else required message should displayed row.
how can achive using javascript or jquery on input button click?
note: i'm not assigning id field number of rows can added dynamically page.
$("#tabletbody tr").each(function(i,row){ $(row).find("yourelementclassname").val(); //perform check here... })
Comments
Post a Comment