• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Sending value of input-form to two pages

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to send information to two different pages and make a reload of both.
One window shows the data in a graphic and the other one is the input window (table).

I have created a form:
<form action='first.php' method='post' name='form1' id='form1'>
<input type='text' name='date' value='12.3.88'>
</form>
and a second one:
<form action_='second.php' method_='post' name='form2' id='form2'>
<input type='text' name='date' value='12.3.88'>
</form>
<input name='sub_mit' type='button' onclick_='form1.submit();form2.submit();' value='Submit'>

The problem now is, that I have to change the value "date" in both forms,
but I just want one form.
As anybody got an idea?
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure what you are asking.
 
Atman Janakar
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want so send same information to two different windows.
When they have send the information I want to make a reload of both windows.

In detail: I have a window which displays the graphic of my anchestors-tree.
Now I want to create a new person. I open another input window, give in the new data, press the submitbutton and send the information to the database. Now I want to see the modified data in the inputwindow and in the window which contains the anchestor-tree.
[ December 02, 2008: Message edited by: Atman Janakar ]
 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not entirely sure if I've understood this but you could write a submitdata() function in the js which contains the logic to send the data to both pages from the original form so that when you call onclick, you call something like onklick=submitdata() and then that function works out what to send to both pages. I used something like this as a test to send data to a Perl script and servlet a while ago though didn't need it for production in the end.

(Yes I know onklick is misspelt but the form won't allow me to submit it correctly - presumably as a safety feature)
 
Atman Janakar
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes that is an idea.
Tank you!

<script type="text/javascript">

function Add () {
window.document.form2.Display.value = window.document.form1.Display.value;

window.document.form1.submit();
window.document.form2.submit();
}
</script>

</head>
<body bgcolor="white">
<form name="form1" action="post" onsubmit=" Add();return false;">
<input type="text" name="Display" value='Text'>
<input type="button" value="Values of the 2ten Formular" onclick_="ADD()">
</form>

<form action='start.php' method='post' name='form2' id='form2' target='win1'>
<input type="text" name="Display" >
</form>

[ December 02, 2008: Message edited by: Atman Janakar ]

[ December 02, 2008: Message edited by: Atman Janakar ]

[ December 02, 2008: Message edited by: Atman Janakar ]
[ December 02, 2008: Message edited by: Atman Janakar ]
 
I knew that guy would be trouble! Thanks tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic