javascript - Trying to pull table values from a selected check box correctly -


i trying pull columns table if checkbox selected. here table contains checkbox called 'selectedsched'

        <tbody style="overflow-y: scroll; ">                     <c:foreach  var="row" items="${updresults}">                     <c:set var="sched" value="${row.getschedule_number()}" />                     <c:set var="eftyear" value="${row.geteft_contract_year()}" />                     <c:set var="eftstatus" value="${row.getstatus()}" />                     <c:set var="schedcombo"  value="${sched}${eftyear}" />                     <fmt:formatnumber var="schedtotl" value="${row.gettotal_amount()}" pattern="$##,###,##0.00"/>                     <tr>                         <td align="center">                              <input style="width:50px;" type="checkbox" name="selectedsched"                                      value="<c:out value="${schedcombo}"/>"/>                           </td>                          <td id="modifyschedulenumber"><c:out value="${row.getschedule_number()}" /></td>                        <td id="modifyyear"><c:out value="${row.geteft_contract_year()}" /></td>                        <td id="modifycreationdate"><c:out value="${row.getcreation_date()}"/></td>                        <td style="text-align: right; padding-right: 5px;"><c:out value="${row.getnum_of_pay_records()}"/></td>                        <td style="text-align: right; padding-right: 5px;"><c:out value="${schedtotl}"/></td>                        <td><select style="width:45px;" size="1" id="modifystatus" name="modifystatus_<c:out value="${schedcombo}"/>"                                     class="combosmall">                            <c:foreach items="${modifylist}" var="statusvalue">                               <option value="${statusvalue}"                                 <c:if test="${eftstatus} = statusvalue"> selected="selected"</c:if>                                  >${statusvalue}</option>                            </c:foreach>                        </select> </td>                        <td>                          <input style="width:85px" id="modifystatusdate" name="modifystatusdate_<c:out value="${schedcombo}"/>"                                  type="text" class="texttable" value="${row.getstatus_date()}"/>                        </td>                        <td><c:out value="${row.getappr_hud_employee()}"/></td>                     </tr>                     </c:foreach>                     </tbody> 

i creating function trying compare creation date field input status date field. here function call:

        $("#submitmefts").mouseup(function ()                     {                          for(var i=0; i<updateformid.selectedsched.length; i++)                          {                   if(updateformid.selectedsched[i].checked == true)                               {                                  var holdcreationdate = $('#modifycreationdate[i]').val();                                 var holdschedule = $('#modifyschedulenumber[i]').val();                                 alert("the checked button clicked");                    }                                else                               {                                   alert("the checked button not clicked") ;                               }                           }                      });   

i have selected check working getting error trying use 'modifycreationdate' field. putting '[i]' @ end invalid. proper way pull correct index of field?

i know servlet call had similar modifystatus field create different "names" each row wondering if there better/cleaner option.

thanks again


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -