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

Discussion in 'HTML' started by Markus Stein, Jan 6, 2008.

  1. Markus Stein

    Markus Stein Guest

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



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

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


    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?
    Markus Stein, Jan 6, 2008
    1. Advertisements

  2. No.
    Jonathan N. Little, Jan 6, 2008
    1. Advertisements

  3. Markus Stein

    Neredbojias Guest

    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.
    Neredbojias, Jan 6, 2008
  4. Markus Stein

    Jeff Guest

    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, Jan 7, 2008
  5. Markus Stein

    Bergamot Guest

    The action attribute was optional in HTML 3.2, but has been required on
    the form element in all versions since then.
    Bergamot, Jan 7, 2008
  6. 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.
    Jonathan N. Little, Jan 7, 2008
  7. Markus Stein

    Jeff Guest

    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, Jan 7, 2008
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.