Forum Moderators: coopster
Thanks in advance for any help.
I have a page that has two forms on it(1 is a join our mailing list, the other is a full contact us with notes page)
They both call different php scripts, however it always to defaulting to the 1st one. Is there anything I can do to make sure it calls the correct one?
Thanks
like this for instance
<form action = "first.php" method = "post">
<input name="text1" type="text" />
<input name="submit1" type="submit" />
</form>
<form action = "second.php" method = "post">
<input name="text2" type="text" />
<input name="submit2" type="submit" />
</form>
if u click the first button it will submit the first form to first.php and if u click the second it will submit the second form to second.php
i'm not sure i understood u .. can u explain more please?
however it always to defaulting to the 1st one.
Does your page validate [validator.w3.org]?
I will place a good bet that your forms are improperly nested or there are other page errors. Example:
<table>
<form>
<tr><td>.......</td></tr>
<tr><td>
<form>
.........
</form>
</td></tr>
</form>
</table>
The horror above is a form inside a form (invalid), improperly nested inside a table. Either will cause erratic behavior, and possibly only post to the "outer" form. Valid code would be something like
<table>
<tr><td>
<form>
.......
</form>
</td></tr>
<tr><td>
<form>
.........
</form>
</td></tr>
</table>
.... or with the form tags OUTSIDE the table. This is most likely not a PHP issue, it is a valid HTML issue.