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
[EMAIL PROTECTED]

-----Original Message-----
From: pablo [mailto:[EMAIL PROTECTED]]
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
[EMAIL PROTECTED]


----- Original Message -----
From: Miguel Loureiro <[EMAIL PROTECTED]>
To: php-gen <[EMAIL PROTECTED]>
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 <[EMAIL PROTECTED] >





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to