Note that there are some explanatory texts on larger screens.

plurals
  1. POUnable to pass value from a row to another page in AJAX
    text
    copied!<p>I have a table with 7 columns(Complaintid id,name,school name etc...) and also have a button. When I click the button I need to pass the complaintid of that row to another page. The problem is that value is not passing in the ajax page.</p> <pre><code>&lt;html&gt; &lt;body&gt; ?&gt; &lt;form action="" name="frmcomplaint" id="frmcomplaint" method="post"&gt; &lt;table border="1" style="border-color: #FFFFFF;" &gt; &lt;tr&gt; &lt;th style="color: #FF0000"&gt;Sl. No&lt;/th&gt; &lt;th style="color: #FF0000"&gt;Complaint Id&lt;/th&gt; &lt;th style="color: #FF0000"&gt;Date&lt;/th&gt; &lt;th style="color: #FF0000; width:200px;" &gt;Name Of student&lt;/th&gt; &lt;th style="color: #FF0000"&gt;District&lt;/th&gt; &lt;th style="color: #FF0000"&gt;School Name&lt;/th&gt; &lt;th style="color: #FF0000"&gt;Standard with &lt;/th&gt; &lt;th style="color: #FF0000; width:200px;"&gt;Complaint&lt;/th&gt; &lt;/tr&gt; &lt;?php while($row=mysql_fetch_array($result)) { $date1=explode('-', $row[$i+2]); $entrydate=$date1[2]."-".$date1[1]."-".$date1[0]; $job_id=$row[$i+1]; ?&gt; &lt;tr&gt; &lt;td style="color: #000000"&gt;&lt;?php echo $j;?&gt;&lt;/td&gt; &lt;td style="color: #000000"&gt;&lt;?php echo $row[complain_Id]; ?&gt; &lt;/td&gt; &lt;td style="color: #000000"&gt;&lt;?php echo $entrydate;?&gt;&lt;/td&gt; &lt;td style="color: #000000" &gt;&lt;?php echo $row[studname];?&gt;&lt;/td&gt; &lt;td style="color: #000000"&gt;&lt;?php echo $row[District];?&gt;&lt;/td&gt; &lt;td style="color: #000000"&gt;&lt;?php echo $row[School_name] ;?&gt;&lt;/td&gt; &lt;td style="color: #000000"&gt;&lt;?php echo $ row[Standard]."-".$row[Division];?&gt;&lt;/td&gt; &lt;td id="disp" &gt;&lt;?php echo $row[Complaint];?&gt;&lt;/td&gt; &lt;td id="button" name="viewbutton" &gt; &lt;input type="button" value="View" class="button" id="'&lt;?php $button; ?&gt;'" onclick="selectedjob(alert('hi there')&lt;?php $job_id ?&gt;)"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;?php $button++; $j=$j+1; } ?&gt; &lt;input type='hidden' value='view' class='button' name="selectedjob" id="selectedjob"&gt; &lt;/table&gt; &lt;/form&gt; &lt;script type="text/javascript"&gt; function selectjob(jobid) { $('#selectedjob').val(jobid); $('#frmSelectJob').attr('action', 'careers-apply.php'); $('#frmSelectJob').attr('method', 'post'); $('#frmSelectJob').submit(); } &lt;/body&gt; &lt;/html&gt; </code></pre>
 

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