JavaScript Aggregate values from selected divs aggregate values in sql,aggregate values in r,aggregate values

I'm trying to pass all the values from some selected divs, where the ids of the divs are the values I want to get and aggregate to a textbox, but I'm not getting any result. Basically I want the id from a div, in for example div id="thisOne" when I click. My script looks like this:

<script>
function myFunction(elmnt, clr) {
    elmnt.style.backgroundColor = clr;
    document.getElementById("allValues").value = document.getElementById(elmnt.value).value;
}
</script>

VIEW:

<form method="POST" action="<?=base_url()?>index.php/dashboard/test_val">
                <div id="frame">
                    <table>
                        <tbody>
                        <?php 
                        for($i = 0, $size = count($farm)-1; $i < $size; $i++) {
                            if($i == 0) 
                                echo '<tr>';

                            if($flag == 1){
                                echo '</tr>';
                                echo '<tr>';
                                $flag = 0;
                            }
                            if($farm[$i]['id_field'] == $farm[$i+1]['id_field']) {
                                echo '<td>';?>
                                <div id="<?php echo $farm[$i]['section_name'] ?>" onclick="myFunction(this, 'red')" style="width:60px; height:60px; border:1px solid #aaaaaa;background:#CCFF99">
                                <center><?php echo $farm[$i]['section_name'] ?></center></div>
                                <?php echo '</td>';
                            }else
                                $flag = 1;

                            if($i == $size - 1)
                                echo '</tr>';
                        }?>
                        </tbody>
                    </table>
                </div>
                <hr>
                <div>
                    <label>Select fertilizer to aplly:</label>
                    <select name="ChoosenFert">
                        <?php foreach ($fertilization as $row) : ?>
                            <option value="<?php echo $row['id'] ?>"> <?php echo $row['type'] ?> </option>                      
                        <?php endforeach;?>
                    </select>
                    <br /> 
                    <button>Apply Fertilizer</button>
                    <input type="text" id="allValues" name="allValues" hidden>
                </div>
            </form>

CONTROLLER:

public function test_val(){
        $inputData = $this->input->post("allValues");
        echo $inputData;
    }
Answer:1

I'm trying to refactor a chunk of code that acts on each variable found in the variables array through by means of putting the variable name and its corresponding callback into an object that is ...

I'm trying to refactor a chunk of code that acts on each variable found in the variables array through by means of putting the variable name and its corresponding callback into an object that is ...

I am trying to json encode a variable to have the value of undefined, as in the javascript keyword undefined. I tried to google this, but the only results that show up are about people getting errors ...

I am trying to json encode a variable to have the value of undefined, as in the javascript keyword undefined. I tried to google this, but the only results that show up are about people getting errors ...

I am using the bootstrap popover for a drop down menu. Is there any way I could disable the popover function either with css media queries or by jquery on page resize and make the menu visible and ...

I am using the bootstrap popover for a drop down menu. Is there any way I could disable the popover function either with css media queries or by jquery on page resize and make the menu visible and ...

  1. disable bootstrap popover
  2. bootstrap disable popover on mobile
  3. ngx-bootstrap disable popover
  4. bootstrap popover disable click
  5. bootstrap popover disable arrow
  6. bootstrap popover disable title

Have looked at many examples but cant seem to get to make an nested array to store some data nicely. How can I get the following code to work? It gives me an error now: var shipdata = []; shipdata['...

Have looked at many examples but cant seem to get to make an nested array to store some data nicely. How can I get the following code to work? It gives me an error now: var shipdata = []; shipdata['...

  1. creating nested array javascript
  2. create nested array php
  3. create nested array python
  4. create nested array
  5. create nested array js
  6. create nested array java
  7. create nested array in jquery
  8. create nested array c#
  9. create nested array laravel
  10. create nested array json
  11. create nested array in angularjs
  12. create nested array typescript
  13. create nested array arduinojson
  14. create nested array of objects
  15. create nested arrays in json objects
  16. create bidimensional array python
  17. create bidimensional array js
  18. creating a nested array from items with parent ids
  19. create a nested array recursively in javascript
  20. create nested json array in java