$_post Problem (How to pass the value of $_post)
<p>I have the following code which works well.</p>

<p>The code is to display all the data from the database in input text field format. User is able to edit and update the details by clicking the update button at the end of each row to update the specific row.</p>

<p>Instead of clicking the update buttons one by one (if user wants to edit and update more than one row), now I would like to create a hyperlink which will update ALL the data at once.</p>

<p>The problem now is I dunno how to pass the value of $_post to the "update.php" since I already have</p>

<pre><code>&lt;form name="form1" action="submitAction.php" method="post"&gt;
</code></pre>

<p>I am not sure is it possible to do so. Or are there any other alternative ways?</p>

<pre><code>&lt;html&gt;
&lt;script language="javascript" &gt;
&lt;!-- hide
function submitRequest(id) {
document.forms[id].submit();
}
// end hide --&gt;
&lt;/script&gt;

&lt;!-- The Javasript (Onclick) to Remove the Readonly Attribute--&gt;
&lt;script language="JavaScript"&gt;
  function removeAlignment(id){
   document.getElementById("ProjectName_"+id).removeAttribute("readonly",0);
   document.getElementById("DeviceType_"+id).removeAttribute("readonly",0);
  }
&lt;/script&gt;

&lt;body&gt;
&lt;?php

$counter=1;
//Connecting and Accessing the Database 
$con = mysql_connect("localhost","root","");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("Project", $con);

$result = mysql_query("SELECT * FROM Project where status='Ongoing'");

?&gt;

&lt;p&gt;&lt;h2 align="center"&gt;ADC Project Funnel&lt;/h2&gt;&lt;/p&gt;
&lt;table border="1" bordercolor="lavender" cellspacing="0" cellpadding="0"&gt;
  &lt;tr&gt;
    &lt;td width="20" bgcolor="steelblue" height="15" style="font-size: 11" align="center"&gt;&lt;b&gt;&lt;font face="Arial"&gt;No&lt;/font&gt;&lt;/b&gt;&lt;/td&gt;
    &lt;td width="78" bgcolor="steelblue" height="15" style="font-size: 11" align="center"&gt;&lt;b&gt;&lt;font face="Arial"&gt;Project
      Name&lt;/font&gt;&lt;/b&gt;&lt;/td&gt;
    &lt;td width="72" bgcolor="steelblue" height="15" style="font-size: 11" align="center"&gt;&lt;b&gt;&lt;font face="Arial"&gt;Device Type&lt;/font&gt;&lt;/b&gt;&lt;/td&gt;
    &lt;td width="67" bgcolor="steelblue" height="15" style="font-size: 11" align="center"&gt;&lt;b&gt;&lt;font face="Arial"&gt;Status&lt;/font&gt;&lt;/b&gt;&lt;/td&gt;
    &lt;td width="67" bgcolor="steelblue" height="15" style="font-size: 11" align="center"&gt;&lt;b&gt;&lt;font face="Arial"&gt;&lt;/font&gt;&lt;/b&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td colspan="15" height="15" bgcolor="#AFEEEE"&gt;&lt;font face="Arial" size="1.9"&gt;Current Project Assignment&lt;/font&gt;&lt;/td&gt;
  &lt;/tr&gt;

  &lt;!-- Records from the database (Current Project Assignment) --&gt;
  &lt;?php 
  $i = 0;
    while ($row=mysql_fetch_array($result)){
  ?&gt;
    &lt;tr&gt;
    &lt;form name="form1" action="submitAction.php" method="post"&gt;
    &lt;td height="5" width="20"  align="center" style="font-size: 13" valign="middle"&gt;&lt;?php echo $counter; ?&gt;&lt;/td&gt;
    &lt;td height="5" width="72" &gt;&lt;input type="text" autocomplete=off readonly="readonly" id="ProjectName_&lt;?php echo $i; ?&gt;" name="ProjectName&lt;?php echo $row['No'];?&gt;" value="&lt;?php echo  $row['ProjectName'];?&gt;" size="20" style="font-size: 10"&gt;&lt;/font&gt;&lt;/td&gt;
    &lt;td height="5" width="72" &gt;&lt;input type="text" autocomplete=off readonly="readonly" id="DeviceType_&lt;?php echo $i; ?&gt;" name="DeviceType&lt;?php echo $row['No'];?&gt;" value="&lt;?php echo  $row['DeviceType'];?&gt;" size="15" style="font-size: 10"&gt;&lt;/font&gt;&lt;/td&gt;
    &lt;td height="5" width="67" style="font-size: 13"&gt;
    &lt;select name="action" onchange="submitRequest(&lt;?php echo $i; ?&gt;);"&gt;
    &lt;option value=&gt;Ongoing &lt;/option&gt;
    &lt;option value="&lt;?php echo $row['ProjectName'];?&gt;"&gt;Complete&lt;/option&gt;
    &lt;option value="&lt;?php echo $row['Flag2'];?&gt;"&gt;Future&lt;/option&gt;
    &lt;option value="&lt;?php echo $row['Flag1'];?&gt;"&gt;Cancel&lt;/option&gt;
    &lt;option value="&lt;?php echo $row['No'];?&gt;"&gt;Update&lt;/option&gt;
    &lt;option value="&lt;?php echo $row['Flag3'];?&gt;"&gt;Delete&lt;/option&gt;
    &lt;/select&gt;                                   
    &lt;/td&gt;
    &lt;td height="5" width="64" &gt;&lt;input type="button" style="width:100%" value="Edit" onclick="removeAlignment(&lt;?php echo $i; ?&gt;);"&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;/form&gt; 
    &lt;?php 

    ?&gt;

  &lt;?php 
  $i++;
  $counter++;
  }
  ?&gt;   


  &lt;tr&gt;
  &lt;td colspan="16" bgcolor="#AFEEEE"&gt;&lt;font face="Arial" size="1.9"&gt;Add New Project Assignment&lt;/font&gt;&lt;/td&gt;
  &lt;/tr&gt;

   &lt;!-- Add New Records --&gt;
  &lt;tr&gt;
   &lt;form action="project_insert.php" method="post"&gt;
     &lt;td width="20" &gt;&lt;/td&gt;
     &lt;td width="78" &gt;&lt;input type="text" autocomplete=off name="ProjectName"  size="40" style="font-size: 10"&gt;&lt;/font&gt;&lt;/td&gt;
     &lt;td width="72" &gt;&lt;input type="text" autocomplete=off name="DeviceType" size="15" style="font-size: 10"&gt;&lt;/font&gt;
     &lt;td width="80" style="font-size: 13"&gt;
         &lt;select name="Status" style="width:100%"&gt;
            &lt;option value=Future&gt;Future&lt;/option&gt;
            &lt;option value=Ongoing&gt;Ongoing&lt;/option&gt;        
         &lt;/select&gt;      
       &lt;/td&gt;
       &lt;td&gt;
        &lt;input type="Submit" style="width:100%"value="Add"&gt;

       &lt;/td&gt;
     &lt;/form&gt;
  &lt;/tr&gt;
&lt;/table&gt;
&lt;br/&gt;

&lt;table border="0" align="center" cellpadding="0" cellspacing="10"&gt;
    &lt;tr&gt;
         &lt;td valign="middle"&gt;&lt;a href="http://localhost/Project/update.php"&gt;update&lt;/a&gt;&lt;/td&gt;

  &lt;/tr&gt;
&lt;/table&gt;

&lt;br/&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
