is it possible to post info of 2 forms?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
php12342005
Forum Commoner
Posts: 79
Joined: Mon Mar 21, 2005 3:35 am

is it possible to post info of 2 forms?

Post by php12342005 »

I have 4 forms on one php file.

form 1 contains user name and password of a database.
there is no submit button on the form.

form 2,3,4 are info of 3 tables of the database.
each form contains submit buttons, such as add new, delete, update and read.

when I click a button on any form (2,3,4), i.e. Read button on form 2, I hope info of both form 2 and 1 are posted because I need user name and password (on form 1) of the database to login.

so:
is it possible to post info of 2 forms when clicking a submit button?
User avatar
nielsene
DevNet Resident
Posts: 1834
Joined: Fri Aug 16, 2002 8:57 am
Location: Watertown, MA

Post by nielsene »

You would have to use JavaScript to on submit of forms 2-4 to copy the fields from form 1 into hidden elements.
php12342005
Forum Commoner
Posts: 79
Joined: Mon Mar 21, 2005 3:35 am

Post by php12342005 »

how?
any code as example?
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Post by josh »

User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

just copy the values from one form to another.

Code: Select all

<form name=&quote;form1&quote;>
<input type=&quote;text&quote; name=&quote;bob&quote; onKeydown=&quote;document.form2.bob2.value = this.value&quote;>
</form>
<form name=&quote;form2&quote;>
<input type=&quote;hidden&quote; name=&quote;bob2&quote;>
</form>
dooms2u
Forum Newbie
Posts: 4
Joined: Mon Jul 18, 2005 4:00 pm
Location: Broomfield, CO.

Post by dooms2u »

Post Reply