Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You Could:</p> <ol> <li><p>Give each of your select's an id that correspond to the row of data.</p></li> <li><p>On change(jQuery), Get the value of the select, and use the jquery ajax call to send the rowID, and the 'StatusValue' to the handling page.</p></li> <li><p>Show an status message on return of data.</p></li> </ol> <p><a href="http://api.jquery.com/jQuery.ajax/" rel="nofollow">http://api.jquery.com/jQuery.ajax/</a></p> <p>--Building the Select </p> <pre><code>&lt;?php for ($i = 0; $i &lt; count($testArray); $i++){ echo '&lt;tr&gt;'; for ($j = 0; $j &lt; count($testArray[$i]); $j++){ echo '&lt;td&gt;'; echo $testArray[$i][$j]; echo '&lt;/td&gt;'; } echo '&lt;td&gt;'; **echo '&lt;select id="' + $testArray[$i][0] + '"&gt;';** echo "'&lt;option value='0'&gt;status1&lt;/option&gt;"; echo "'&lt;option value='1'&gt;status2&lt;/option&gt;"; echo '&lt;/select&gt;'; echo '&lt;/td&gt;'; echo '&lt;/tr&gt;'; } ?&gt; </code></pre> <p>--The jQuery (you will need the jquery file, download from jquery.com)</p> <pre><code>$(document).ready(function(){ $('select').change(function () { var rowIdVal = $(this).attr('id'); // the id of the select (your rowID) var statusVal = $(this).val(); // the value of the select // post id to the server using ajax (you can use jQuery ajax request) ////I would check if the values are valid and not null... $.ajax({ type: "POST", url: "YOURHANDLERFILE.php", data: {status: statusVal, rowId: rowIdVal}, success: function(d){ //show a status message } }); }); }); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload