Passing form variables

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • sindre

    Passing form variables

    Hi,

    I have a form with many fields. And then I thought I could have two other
    forms similar but here is only the submit button visible.
    What I want is: if the user click on a submit button on a hidden form the
    information typed into the visible form is copied two the not
    visible form and submitted.
    This way I can submit the visible form to three pages depending on the form
    submitted.

    Is this possible?

    Regards,

    Sindre


  • McKirahan

    #2
    Re: Passing form variables

    "sindre" <sindrehi@c2i.n et> wrote in message
    news:4G96d.5322 8$Vf.2561304@ne ws000.worldonli ne.dk...[color=blue]
    > Hi,
    >
    > I have a form with many fields. And then I thought I could have two other
    > forms similar but here is only the submit button visible.
    > What I want is: if the user click on a submit button on a hidden form the
    > information typed into the visible form is copied two the not
    > visible form and submitted.
    > This way I can submit the visible form to three pages depending on the[/color]
    form[color=blue]
    > submitted.
    >
    > Is this possible?
    >
    > Regards,
    >
    > Sindre
    >[/color]
    Perhaps a variation of the following?

    <html>
    <head>
    <title>forms.ht m</title>
    <script type="text/javascript">
    function submits() {
    var form1 = document.form1;
    var form2 = document.form2;
    var form3 = document.form3;
    form1.Field2.va lue = form2.Field2.va lue;
    form1.Field3.va lue = form3.Field3.va lue;
    return true;
    }
    </script>
    </head>
    <body>
    <form name="form1" onsubmit="retur n submits()">
    <input type="text" name="Field1" value="1">
    <input type="hidden" name="Field2" value="1">
    <input type="hidden" name="Field3" value="1">
    <br><input type="submit" value="Submit Form">
    </form>
    <form name="form2">
    <input type="hidden" name="Field2" value="2">
    </form>
    <form name="form3">
    <input type="hidden" name="Field3" value="3">
    </form>
    </body>
    </html>


    Comment

    • sindre

      #3
      Re: Passing form variables

      [color=blue]
      > Perhaps a variation of the following?
      >
      > <html>
      > <head>
      > <title>forms.ht m</title>
      > <script type="text/javascript">
      > function submits() {
      > var form1 = document.form1;
      > var form2 = document.form2;
      > var form3 = document.form3;
      > form1.Field2.va lue = form2.Field2.va lue;
      > form1.Field3.va lue = form3.Field3.va lue;
      > return true;
      > }
      > </script>
      > </head>
      > <body>
      > <form name="form1" onsubmit="retur n submits()">
      > <input type="text" name="Field1" value="1">
      > <input type="hidden" name="Field2" value="1">
      > <input type="hidden" name="Field3" value="1">
      > <br><input type="submit" value="Submit Form">
      > </form>
      > <form name="form2">
      > <input type="hidden" name="Field2" value="2">
      > </form>
      > <form name="form3">
      > <input type="hidden" name="Field3" value="3">
      > </form>
      > </body>
      > </html>
      >[/color]

      Thank you, that helped me a lot. I could use this, in a rewritten way.

      Sindre


      Comment

      Working...