Trying to return a value from a single cell using the map function
Not sure this is the correct forum, this is my first time posting, here. I apologize if it's not. In my program, I place data into a cell in a table from a popup
- <script>
- function updateValue(driver_name, value){
- var which_driver = value;
- //alert("Driver Is " + value);
- //alert("Row Is " + whichRow);
- reservations.rows[whichRow].cells[7].innerHTML = which_driver;//
- //reservations.rows[whichRow].cells[7].textContent = which_driver;
- //'#reservations tr:eq(whichRow) td:eq(8)'.text('Test');
- //console.log(testelements);
- }
- </script>
- The data shows up fine when I use either innerHTML or textContent, however I use this function to try and retrieve the values of certain checked rows.
- <script type="text/javascript">
- $(function()
- {
- $('#submitButton').click(function(){
- var values = $("#main_table table input[name=name]:checked").map(function() {
- row = $(this).closest("tr");
- return {
- recordid : $(row).find('input[name=record_id]').val(),
- firstname : $(row).find('input[name=firstname]').val(),
- lastname : $(row).find('input[name=lastname]').val(),
- timeneeded : $(row).find('input[name=timeneeded]').val(),
- dateneeded : $(row).find('input[name=dateneeded]').val(),
- pickup : $(row).find('input[name=pickup]').val(),
- dropoff : $(row).find('input[name=dropoff]').val(),
- drivername : $(row).find('td:lt(7):gt(6)').text()
- }
- }).get();
- console.log(values);
- });
- });
- </script>
- When I view the objects in the console every part of the array is filled in with the exception of 'drivername', the code I use is now returning enough empty spaces to show it hit the correct cell, but nothing shows up. Does anyone have any suggestions
- TIA