Link to home
Start Free TrialLog in
Avatar of tr5
tr5

asked on

Submitting multiple forms using javascript's submit()

Hi

I have 2 forms on the same page. I use this for the submit buttons:

<INPUT onclick=document.f1.submit(); type=button value="Send f1">
f1 is form name

on the 2nd form:

<INPUT onclick=document.f2.submit(); type=button value="Send f2">
f2 is form name

The problem is in my PHP script. How do I know when the different forms were submitted?
I try
if(isset($_POST['submit']))
but it doesn't work.

Only if I define the button with type=submit does it work.

Also how do I tell which form was sent?

Thanks
tr5

ASKER CERTIFIED SOLUTION
Avatar of Roonaan
Roonaan
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial