Welcome to WebmasterWorld Guest from 18.205.176.85

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Two "form actions" destination & one click submit

Transforming two actions in only one submit !

     
9:16 pm on Jul 8, 2003 (gmt 0)

Senior Member from FR 

WebmasterWorld Senior Member henry0 is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Apr 19, 2003
posts:4449
votes: 11


Hello
I did cut through the HTML showing only what matters
I cannnot figure how sending input from two separated
"form action" (update.php and update_2.php) using only one submit button
the only totally inelegant solution I found is having 2 buttons, sent the first set, go back and send the second one

I always have some unpleasant moments with forms :)

any input

thank you

regards

<form action ="update.php" method="post">
Enter Username (Writer):<input type="text"name="writer" value="<?php echo $writer;?>">
<br>
Enter Page (Code or Segment name):<input type="text"name="page" value="<?php echo $page;?>">

<br>
<input type="submit"></form>
</tr></td>

<!--// second set -->
<tr>
<td width="640" align="left" valign="top">
<form action ="update_2.php" method="post">
Enter Username (SAME as Username):<input type="text"name="username" value="<?php echo $username;?>">
<br>
Enter Password (Password):<input type="text"name="password" value="<?php echo $password;?>">
<br>
Enter First and Last Name (Full Name):<input type="text"name="full_name" value="<?php echo $full_name;?>">

9:25 pm on July 8, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member marcia is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Sept 29, 2000
posts:12095
votes: 0


Is that controlled by the HTML, or is it something that's configured and controlled from within the code of the PHP script? It sounds like more of a back end issue than on-page HTML.
9:59 pm on July 8, 2003 (gmt 0)

Senior Member from FR 

WebmasterWorld Senior Member henry0 is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Apr 19, 2003
posts:4449
votes: 11


HEllo Marcia,
the form is simply HTML form
it only does send the $var input to the rest of the php script
so we can even forget all PHP coding
and rephrase my quest as:
how may I send to different sets of input to two different location (URL of the php files)
by only using one submit to do the whole work

as is it works but as I mentioned it requires to go back and click the second submit button
which does not sound correct!

thank you

2:01 am on July 9, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:May 26, 2000
posts:37301
votes: 0


After some talk with jatar_k, we've moved this question to the PHP Forum -- not because of the PHP you already are using, but because sending data two different places from one form will probably require server-side scripting. It's not a built-in cabability of HTML.
2:35 am on July 9, 2003 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lorax is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Mar 31, 2002
posts:7577
votes: 4


The only possible thing I can think of is to use javascript and the onSubmit event such that the submit button would be used to submit one form and that <form> tag would have an onSubmit event in it that would call a function to submit the second form. You'll have to give the second form a name so you can call it. I haven't tried this but in theory I believe it would work.
5:14 am on July 9, 2003 (gmt 0)

Junior Member

10+ Year Member

joined:Oct 8, 2002
posts:65
votes: 0


I'd say either go to one destination first, process and forward on with scripting, or if you can use a "get" based form, you could use javascript to spawn a new window on click....
8:33 am on July 9, 2003 (gmt 0)

Senior Member from MY 

WebmasterWorld Senior Member vincevincevince is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Apr 1, 2003
posts:4847
votes: 0


as tedster says... server side is the way to go

send the form output to one php file only - then either make that file handle both sets of data by merging your two existing scripts - or get it to forward the data on after use to the 2nd script.

11:36 am on July 9, 2003 (gmt 0)

Senior Member from FR 

WebmasterWorld Senior Member henry0 is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Apr 19, 2003
posts:4449
votes: 11


Thank you all
I am not a JS accomplished person
althouogh it makes sense; I'll stick with PHP
that I am more familiar with
regards

Henry