HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignHTML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 9th, 2000, 02:11 AM
gone-fshn gone-fshn is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2000
Location: poway ca usa
Posts: 2 gone-fshn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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??

Reply With Quote
  #2  
Old September 13th, 2000, 06:55 AM
MeijdenB MeijdenB is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2000
Location: Alkmaar, The Netherlands
Posts: 123 MeijdenB User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > Posting Data with forms


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT