Log in

View Full Version : Mulitple Forms on same page



queerfm
04-21-2009, 12:57 PM
Hi Guys, I am having a HUGE problem I am using Javascript to submit forms on a PHP page.

Form Code


<form style="margin: 0px; padding: 0px;"><?php echo $msg_from_image;?><input id="pokeid" value="<?php echo $pokeid;?>" name="pokeid" size="10" Type="hidden">

<input id="from" value="<?php echo $to_id;?>" name="from" size="10" Type="hidden">

<input id="to" value="<?php echo $from;?>" name="to" size="10" Type="hidden">

<input id="delete" value="1" name="delete" size="10" Type="hidden">

<input class="button" onClick="DeleteFunction();" value="Delete" type="button" ></form>


However when I run this code and i have 3 forms on the same page, it deletes the first form not the one that i want to delete.

If anyone can help that would be nice.
Thanks
Russell Harrower

ganu
04-21-2009, 02:03 PM
a form never begin without ending the previous form.

its not a problem that a page may contain any number of forms

please verify on closing and begining of forms.

if it is your mistake then ok.
other wise

there is no full code to understand this

queerfm
04-21-2009, 03:28 PM
If you look at that code, you will see the form and the /form so i did end the form code.

amutha
04-22-2009, 09:58 AM
a form never begin without ending the previous form.

its not a problem that a page may contain any number of forms

please verify on closing and begining of forms.

if it is your mistake then ok.
other wise

there is no full code to understand this

Give the full coding or check your code, if don't close the form tag, verify the code :)

aakinn
04-24-2009, 01:12 PM
Try looking at the following thread i had a similar problem and this seemed to work. Could be where u initialize the variables in the javascript

http://www.dynamicdrive.com/forums/showthread.php?t=43536