File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sending value of input-form to two pages

 
Atman Janakar
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • 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?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64196
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure what you are asking.
 
Atman Janakar
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • 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 ]
 
Iain Emsley
Ranch Hand
Posts: 60
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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 agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic