Passing input values between pages.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DLP35
    New Member
    • Sep 2007
    • 11

    Passing input values between pages.

    I'm sure this should be simple enough but I'm really struggling to get my mind around this. I don't have access to a server but am developing a site and I need to pass information from input boxes on one form to a paragraph of text on another.

    The simplest example I could think of would be a first page with input boxes for Title and Surname:
    [html]
    <head>

    <title>Test</title>

    <table>

    <tr>
    <td>Title:</td>
    <td><p>
    <input name="Title" type="text" id="Title" size="20" maxlength="4">
    </p> </td>
    </tr>
    <tr>

    <td>Surname:</td>
    <td><input name="Surname" type="Text" id="Surname" size="35" maxlength="50"> </td>
    </tr>


    <td><input name="Reset" type="Reset"
    value="Clear Form" />
    <a href="Test_Page 2.html">Next</a>
    </body>
    </html>
    [/html]

    and a second page which would then show the values in text.

    [html]
    <head>

    <title>Untitl ed Document</title>
    </head>

    <body>
    Hello
    </body>

    </html>
    [/html]
    So if I open the first page and put in Mr and Smith the second page reads "Hello Mr Smith"

    I've read some information about querystrings and passing information through the link and retrieving it in the next page but can someone help to explain it in this example so I can see it working.

    Thanks.
    Last edited by drhowarddrfine; Sep 1 '07, 09:41 PM. Reason: Added code tags
  • Death Slaught
    Top Contributor
    • Aug 2007
    • 1137

    #2
    You could just use Javascript in my opinion it would be easier heres a link to it just find the javascript tutorial on the left.

    Thanks, Death

    Comment

    • Death Slaught
      Top Contributor
      • Aug 2007
      • 1137

      #3
      O and please use proper HTML tags you can find them above the textbox the HTML one looks like this <>

      - Death

      Comment

      • DLP35
        New Member
        • Sep 2007
        • 11

        #4
        Thanks, Not sure what happened to the tags, pasted out and back into Dreamweaver fine.

        Any other thoughts out there?

        Comment

        • drhowarddrfine
          Recognized Expert Expert
          • Sep 2006
          • 7434

          #5
          As stated, if the form is on the same page then you must use javascript, or submit the form to a server where the language there can handle it and reserve the page.

          Comment

          • DLP35
            New Member
            • Sep 2007
            • 11

            #6
            OK & thanks for updating the text.

            The input side is on a different page to the output side but within the same browser session and it won't be interacting with a server.

            What would the javascipt be on the two pages in the example above?

            It might seem that I'm being stupid, but I'm not going to "get it" from reading another set of online tutorials (we do all have different learning styles after all)
            - but I'm convinced if i can just see it working in a simple example like this I can apply the principles in my design.

            Thanks again.

            Comment

            • drhowarddrfine
              Recognized Expert Expert
              • Sep 2006
              • 7434

              #7
              You need to ask that question on the javascript board.

              Comment

              Working...