Page 1 of 1

is it possible to post info of 2 forms?

Posted: Tue Jul 26, 2005 11:38 am
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?

Posted: Tue Jul 26, 2005 11:41 am
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.

Posted: Tue Jul 26, 2005 12:00 pm
by php12342005
how?
any code as example?

Posted: Tue Jul 26, 2005 1:29 pm
by josh

Posted: Tue Jul 26, 2005 2:11 pm
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>

Posted: Tue Jul 26, 2005 3:04 pm
by dooms2u