Forum Moderators: open

Message Too Old, No Replies

2nd form won't submit

submitting 2 forms separately to 2 PHP pages

         

filmmaker 2001

5:55 am on Jul 8, 2003 (gmt 0)

10+ Year Member



Hello folks, would really appreciate any help with the following:
I have a page with 2 select-based forms -- each posts data to a separate PHP page set up as the action, the results of which appear in an iframe on the same page as the drop-down boxes. As far as I can tell, both are written identically, and yet only the first one works. This first pair works fine:
---------------------------------------------------------
<form action="search_results2.php" method="POST" id="dealerform" name="dealerform" target="results">
<select style="width: 200px;" name="dealerlist" size="1">
<option selected value=" ">Search by Dealer Name</option>
<option value="frags/29230.htmlf">first dealer name</option>

/* here's the "receiving" code on "search_results2.php": */

<?php
($_POST['dealerlist']);
$dealer = $_POST['dealerlist'];
if ($dealer);
include "$dealer";
?>
-------------------------------------------------
This pair does _NOT_ work:
-------------------------------------------------
<form action="search_results2a.php" method="POST" id="zipform" name="zipform" target="results">
<select class="select" style="width: 200px;" name="dealerzip" size="1">
<option selected value=" ">Search by Zip Code</option>
<option value="zip_80012.html">80012</option>

/* again, the action page code on search_results2a.php: */

<?php
($_POST['dealerzip']);
$zip = $_POST['dealerzip'];
if ($zip);
include "$zip";
?>
---------------------------------------------------------
Am I blind? Would actually welcome hearing that about now -- ANY HELP massively appreciated ;-)
filmmaker_2001

jpjones

7:25 am on Jul 8, 2003 (gmt 0)

10+ Year Member



Hi Filmmaker_2001,
Welcome to WebMasterWorld [webmasterworld.com].

I've had two forms working on the same page before now - it's perfectly legal HTML.

You're not posted your whole code below, which is fine.
Have you gone through your code and made sure that you've closed the form tag on both forms? (Seems obvious but I've done it myself)

How are the selections submitted? Automatically through JavaScript (though I see no hooks through any onChange code), or through a submit button/image?

JP

filmmaker 2001

8:41 am on Jul 8, 2003 (gmt 0)

10+ Year Member



JP -- many, many thanks for the swift reply.

Yep, you got it. After 27 hrs straight you can go blind. The form was fine; turns out I was missing a trailing double quote at the end of a "style= declaration. Tonight we have learned the value of having a DEBUGGER handy... ;-)

filmmaker_2001