submitting two forms on one page

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hey everyone,  I'm having issues with a couple of forms that exist on one
page.  Basically what I'm trying to do is the following:

Select a client from a dropdown select box(submit inner form). Based on
that, another select menu appears that retrieves a list of projects based on
the client selected.  Then you choose a file and upload it(submit the outer
form) which uploads the file and adds the file entry under the client
project table selected in the 2nd dropdown.

The problem is that the outer form works fine, but the inner form that
dynamically retrieves the client project list doesn't refresh the page or
post so the project list never shows up.  I've listed some code below.

Thanks in advance for any help on this.
Adil.


<?php
echo "<form name=\"mainform\" enctype=\"multipart/form-data\"
method=\"post\"><table cellpadding=\"0\" cellspacing=\"0\" border=\"0\"
width=\"100%\">       \\  The outer form starts here
<tr>
 <td valign=\"top\">
  <form name=\"client_picker\" action=\"{$_SERVER['PHP_SELF']}\"
method=\"post\">        \\ The inner form starts here
  <select name=\"client_list[]\"
onClick=\"document.client_picker.submit()\">
   <option selected value=\"0\">Select Client</option>
   <option value=\"1\">Bank of America</option>
   <option value=\"2\">Verizon</option>
   <option value=\"3\">Verizon Wireless</option>
   <option value=\"4\">AARP</option>
  </select><br><br>
  </form>
\\ The inner form ends here
 </td>
</tr>
<tr>
 <td valign=\"top\">";
  if ($_POST['client_list']) {
   getProjects();
  }
echo "</td>
</tr>
<tr>
 <td valign=\"top\">
  <input name=\"hidden\" type=\"hidden\">
  <font class=\"fieldTextDark\">Fill out the form to upload a
file:</font><br><br>
  <p class=\"fieldTextDark\">File: <input type=\"file\" name=\"upload\"
/></p>
  <p class=\"fieldTextDark\">Description: <textarea name=\"description\"
cols=\"40\" rows=\"5\"></textarea></p>
  <div align=\"center\">
   <input type =\"submit\" name=\"submit\" value=\"Submit\" /><br><br>
   <textarea name=\"message\" cols=\"40\" rows=\"4\"></textarea><br>
   <input type=\"submit\" name=\"Post\" value=\"Post\">
  </div>
 <!--End of form-->
 </td>
</tr>
</table>
</form>";
\\ The outer form ends here
?>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux