Re: submitting two forms on one page

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

 



On Tue, 23 Nov 2004 17:43:22 -0500, Adil <aasheer@xxxxxxxxxxxx> wrote:
> 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.

Looks like your javascript is messed up somehow, is that all of it?

> <?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\">";

You might check out PHP's heredoc syntax of you plan to echo all your
html like that.

<?php

echo <<<EOF
<form method="post" action="$_SERVER[PHP_SELF]">
<input type="text" name="field">
<input type="button" name="submit">
</form>
EOF;

?>

Nice and clean, no escaping required, variables parse, all that..


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

-- 
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