Posted by Markus Stein on 01/13/08 19:07
In a previous thread I asked "How to exchange data between forms in one document with pure HTML"?
Now I find a solution not with pure HTML but with a little bit of Javacript
(onclick="this.form.textfeld.value='...'). But I have not a question
about JavaScript but about the correctness of my code.
It works. But is it also correct?
Is it Standard HTML that I can see in a form the variables
that I have defined in another form?
This works with FF1.5 and IE7:
<html>
<head>
<title>Formular-Test</title>
</head>
<body>
<h3>Formular Test</h3>
<h3>Formular 1</h3>
<form name="Formular1" action="input_button.htm">
<p>
<textarea cols="20" rows="4" name="textfeld"></textarea>
<input type="button" name="Text 1" value="Show text 1"
onclick="this.form.textfeld.value='ABC'">
<input type="button" name="Text 2" value="Show text 2"
onclick="this.form.textfeld.value='123'">
</p>
</form>
<h3>Formular 2</h3>
<form name="Formular2" action="input_button.htm">
<p>
<textarea cols="20" rows="4" name="textfeld2"></textarea>
<input type="button" name="Text 3" value="Show Textarea from formular 1"
onclick="this.form.textfeld2.value=Formular1.textfeld.value">
</p>
</form>
</body>
</html>
[Back to original message]
|