Note that there are some explanatory texts on larger screens.

plurals
  1. POJquery Get input value from loop
    primarykey
    data
    text
    <p>I want to make an inline editing solution using php, jquery, ajax</p> <p>My Loop:</p> <pre><code>$a=0; while($row = $db-&gt;fetch_array($res)){ if($a%2==1){ $class = 'class="even"'; } else{ $class = 'class="odd"'; } $a++; </code></pre> <p>Html Table:</p> <pre><code> &lt;tr &lt;?php echo $class; ?&gt;&gt; &lt;td class="th table-check-cell sorting_1"&gt;&lt;input type="checkbox" name="zones_id[]" value="&lt;?php echo $row['zone_id']; ?&gt;"&gt;&lt;/td&gt; &lt;td&gt;&lt;?php echo $a; ?&gt;&lt;/td&gt; &lt;td&gt;&lt;?php echo $row['zone_name']; ?&gt;&lt;/td&gt; &lt;td&gt;&lt;?php echo $row['zone_position']; ?&gt;&lt;/td&gt; &lt;td&gt;&lt;?php echo $row['status']; ?&gt;&lt;/td&gt; &lt;td class="table-actions"&gt; &lt;a href="javascript:void(0);" title="Edit" class="with-tip" onclick="slidemenu('innerlinks_&lt;?php echo $a; ?&gt;')"&gt;&lt;img src="images/icons/fugue/pencil.png" width="16" height="16"&gt;&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr style="display:none;" id="innerlinks_&lt;?php echo $a; ?&gt;" class="sub"&gt; &lt;td&gt;&lt;?php echo $a; ?&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="checkbox" /&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="text" class="zn" name="zone_name" id="zone_name" value="&lt;?php echo $row['zone_name']; ?&gt;" /&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="text" name="zone_pos" id="zone_pos" value="&lt;?php echo $row['zone_position']; ?&gt;" /&gt;&lt;/td&gt; &lt;td colspan="2"&gt;&lt;a&gt;&lt;?php echo $row['zone_name']; ?&gt;&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; &lt;?php } ?&gt; function slidemenu(id){ $('#'+id).slideToggle(); } ///second proccess $(".sub").click(function(){ $(this).closest('tr').find("input,select").each(function() { $.ajax({ type: "POST", url: "&lt;?php echo SITE_URL .'controlls/zone_add.php'; ?&gt;", data: datastring, success: function (data) { alert("Details saved successfully!!!"); } }) }); }); </code></pre> <p>I want two things:</p> <p>One is hide my data row and show form row for editing. Second is how to get all input select radio etc by there name for ajax request </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    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. 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