RE: [PHP] variable on 2 forms
| From: | Rudolf Visagie | Date: | Wed, 14 Mar 2001 15:14:06 +0000 |
| Subject: | RE: [PHP] variable on 2 forms | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-43851@lists.php.net to get a copy of this message | ||
I don't know if this fixes your problem but this worked for me. Define a
Javascript function:
function PassRequest(what) {
document.fields_frm.p_request.value=what
}
and then in the form you could perhaps have:
<td valign="top">
<input type="hidden" name="p_request">
<input type="image" src="images/insert.jpg" width="53" border=0
alt="Insert" onClick="PassRequest('Insert')">
</td>
When the user clicks on the insert button it passes 'Insert' in $p_request.
Rudolf Visagie
rudolf@qedi.co.za
-----Original Message-----
From: pablo [mailto:pablo@e-nov.com]
Sent: 14 March 2001 04:58
To: Miguel Loureiro; php-gen
Subject: Re: [PHP] variable on 2 forms
I think you'll need to use javascript.
put a input with the type "hidden" in the first form with no value.
Call a javascript function on the submit button or image action.
This javascript must set the hidden input in form1 with the var2 value
before submiting the form to the script.
the object structure for the forms in javascript is :
document.forms[].elements[].value
Good luck.
Pablo
pablo@e-nov.com
----- Original Message -----
From: Miguel Loureiro <m.loureiro@distrim2.pt>
To: php-gen <php-general@lists.php.net>
Sent: Wednesday, March 14, 2001 3:58 PM
Subject: [PHP] variable on 2 forms
Hello all,
I have a normal form (form1) with a variable (var1) and a form inside a
layer (form2) with a variable (var2).
After submit (form1), how can I have access to var2 ? (if I must use
javascript should use: document.layer.var2 or document.form2.var2 or
document.layer.form2.var2 .......???).I try to read directly $var2, but
without result....
T.Y all
Best Regards
Miguel Loureiro <m.loureiro@distrim2.pt >
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net