|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
What I would like to do is create a form that will post data to more than one recipient. For instance
<FORM ACTION="http://www.ibm.com" ACTION="http://www.hp.com" ACTION="http://www.elvis.com" METHOD="POST" NAME="PostTopic"> Any suggestions on how I can do this using javascript or something else?? |
|
#2
|
|||
|
|||
|
I actually don't know if you can do it with one form. However you could make three (or more) forms.
The first form like it is right now. The other forms have the exact same fields, only they are hidden. What you would do now is write a function that is called when a form element from the first (visible) form is changed (onChange event), which then changes the values for the hidden fields in the other forms. Finally there is a function that is executed on submit and which submits the other forms for you. It would be looking something like this: <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre> <HTML> <HEAD><TITLE>Multiple forms</TITLE> <SCRIPT LANGUAGE="Javascript"> <!-- function submitAll() { document.forms[1].submit(); document.forms[2].submit(); } function changeField1() { document.forms[1].Field1.value=document.forms[0].Field1.value; document.forms[2].Field1.value=document.forms[0].Field1.value; } //--> </HEAD> <BODY> <FORM ACTION="http://www.ibm.com" METHOD="POST" NAME="PostTopic" onSubmit="submitAll();"> <INPUT TYPE="TEXT" NAME="Field1" VALUE="Some text" onChange="changeField1()";> </FORM> <FORM ACTION="http://www.hp.com" METHOD="POST" NAME="PostTopic2"> <INPUT TYPE="HIDDEN" NAME="Field1" VALUE="Some text"> </FORM> <FORM ACTION="http://www.elvis.com" METHOD="POST" NAME="PostTopic3"> <INPUT TYPE="HIDDEN" NAME="Field1" VALUE="Some text"> </FORM> </BODY> </HTML> [/code] Hope this will help for you. ------------------ Good luck, Bas ------------------ E-mail me at: b.vandermeijden@pecoma.nl |
![]() |
| Viewing: Dev Shed Forums > Web Design > HTML Programming > Posting Data with forms |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|