Page 1 of 1

Multiple form on one page

Posted: Sun Mar 12, 2006 8:07 am
by creatco
i have 3 form on one page. The first form have fields as name adress ...
The second form is only vibible by select a radio button on the first form.
The tird form only have one button. Can y now request in a php info from the first button by only clicking on the submit button/
Something like this.

$_REQUEST=[form1.name]

How can help me.

Thx

Posted: Sun Mar 12, 2006 8:28 am
by jayshields
Your english is very bad, and your question is very hard to understand.

As far as I can understand, you've got 3 forms on one page, some of them have toggleable visibility.

If your form method is set to post, you can grab the values by using the $_POST superglobal, it's more secure than $_REQUEST.

You should name all your form elements differently, then you will be able to grab the value of the form element using $_POST['formelementname']. The example you've given is not correct in PHP, form1.name is something that would be used in JavaScript.

Posted: Sun Mar 12, 2006 8:36 am
by creatco
Sorry for my bad English. I will try to explain better wath I want to do.
I have indeed one page with 3 forms on. I want when I click on the submit button of form3 that I can read in a php file the info what is in form1 to send by mail.

This is the form action

<form action="sendmail.php" method="post" name="bevestig" onsubmit="return controle(document.f.info.valeu)">

and in the sendmail.php I have this :

$bedrijf = $_REQUEST['bedrijf']

bedrijf is a field on the form “f” on the same page as the form “bevestig”

when I do this I get this error.

Notice: Undefined index: bedrijf in C:\Creatcodataweb\TEXACO2005\sendmail.php on line 3

I hope this is better to understand

Posted: Sun Mar 12, 2006 9:17 am
by feyd
Only one form is submitted at any given time. Combine them into a single form or put a submit button in each.