How to exchange data between forms in one document with pure HTML?


M

Markus Stein

Is there a possibility to exchange data between
forms in one html document with pure html (no PHP,
no server variables etc.)?

Example:

<html>
<head>
</head>
<body>

<!-- formular1: -->
<form>
<input type="text" name="inputformular1"/>
<input type="submit" name="sendformular1"/>
</form>

<!-- formular2: -->
<form>
<input type="text" name="inputformular2"/>
<input type="submit" name="sendformular2"/>
</form>

</body>
</html>

I want that if I click on the sendformular1 button
the text in field inputformular1 appears in inputformular2
and vice versa.

Is it possible with pure html?
 
Ad

Advertisements

J

Jonathan N. Little

Markus said:
Is there a possibility to exchange data between
forms in one html document with pure html (no PHP,
no server variables etc.)?

Example:

<html>
<head>
</head>
<body>

<!-- formular1: -->
<form>
<input type="text" name="inputformular1"/>
<input type="submit" name="sendformular1"/>
</form>

<!-- formular2: -->
<form>
<input type="text" name="inputformular2"/>
<input type="submit" name="sendformular2"/>
</form>

</body>
</html>

I want that if I click on the sendformular1 button
the text in field inputformular1 appears in inputformular2
and vice versa.

Is it possible with pure html?

No.
 
N

Neredbojias

Well bust mah britches and call me cheeky, on Sun, 06 Jan 2008 20:28:44 GMT
Markus Stein scribed:
Is there a possibility to exchange data between
forms in one html document with pure html (no PHP,
no server variables etc.)?

Example:

<html>
<head>
</head>
<body>

<!-- formular1: -->
<form>
<input type="text" name="inputformular1"/>
<input type="submit" name="sendformular1"/>
</form>

<!-- formular2: -->
<form>
<input type="text" name="inputformular2"/>
<input type="submit" name="sendformular2"/>
</form>

</body>
</html>

I want that if I click on the sendformular1 button
the text in field inputformular1 appears in inputformular2
and vice versa.

Is it possible with pure html?

No, but you could do something with javascript. Btw, forms need an
"action" attribute.
 
J

Jeff

Neredbojias said:
Well bust mah britches and call me cheeky, on Sun, 06 Jan 2008 20:28:44 GMT
Markus Stein scribed:


No, but you could do something with javascript. Btw, forms need an
"action" attribute.

I believe that if you leave out action, most browsers will point back
at the page URL. Not good practice though...and that certainly wouldn't
help if it wasn't what you wanted!

Jeff
 
B

Bergamot

Jeff said:
I believe that if you leave out action, most browsers will point back
at the page URL.

The action attribute was optional in HTML 3.2, but has been required on
the form element in all versions since then.
 
J

Jonathan N. Little

Jeff said:
I believe that if you leave out action, most browsers will point back
at the page URL. Not good practice though...and that certainly wouldn't
help if it wasn't what you wanted!

It will not do what OP wishes and that is transfer and process data. You
need scripting for that. HTML is not a scripting language, it doesn't
"do" anything.
 
Ad

Advertisements

J

Jeff

Jonathan said:
It will not do what OP wishes and that is transfer and process data. You
need scripting for that. HTML is not a scripting language, it doesn't
"do" anything.
Lets say for an example that the form is on a server page and if it
receives either post or get data it will do something with it. If not it
will display the form. That is not an unusual setup.

Note Bergamots post on action being optional in 3.2. Certainly
without a doctype it wouldn't be html 4.

It's all a minor point and I hope I won't regret bringing it up!

Jeff
 

Top