IE mixing forms

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
m2babaey
Forum Contributor
Posts: 364
Joined: Sun May 20, 2007 9:26 am

IE mixing forms

Post by m2babaey »

Hi
I have a page in which use multiple forms in a table and another form
one form contains checkboxes in each table row and other forms are save buttons having some hidden fields each
Here is a display of my description:
Image
I noticed that when I use IE, and press submit for checkboxes, none of form fields are sent to the action page
Here is sample of the html code:

Code: Select all

<form method="post" action="contact-page.php" style="display: inline;"> <tr><td align="center"><font size="-2"> <form style="margin: 0pt; padding: 0pt;"><input name="vname" id="vname" value="email@usa.com" type="hidden"><input name="myname" id="myname" value="matt@email2.com" type="hidden"><input name="txthintid" id="txthintid" value="4" type="hidden"><div id="txtHint4"><input value="Save" onclick="saveinfo(vname.value,myname.value,txthintid.value)" type="button"></div></form> </font></td> <td><font size="-2">Anaheim</font></td><td><font size="-2"><a href="http://domain.com/" class="gray">Website</a></font></td><td align="center"><a href="http://www.mysite.com/contact-vendor.php?bname=Advanced%20Video%20-%20Orange%20County%20Wedding%20Video&bemail=email@usa.com"> <img src="test.php_files/envelope.gif" alt="Contact Vendor" border="1"></a></td><td align="center"><input name="check1" value="Advanced Video - Orange County Wedding Video_toexplode_aemail@usa.com" type="checkbox"></td></tr> similar table rows here</form>
How can I prevent this problem?
Thanks for your help
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: IE mixing forms

Post by jackpf »

I don't think you're supposed to "do" nested forms....

I'd recommend you use javascript to change the form action with the onclick event of a certain button.
Post Reply