Results 1 to 2 of 2

Thread: Forms and the POST method

  1. #1
    Join Date
    May 2006

    Forms and the POST method

    Hi guys.

    I have searched and searched and searched and I can't seem to find a solution to what may be a simple problem.

    I have two web pages - quiz and results.

    I want to pass the information from the quiz page to the results page using the post method.

    Then on the results page I need javascript code (I dont have a server) to access the information passed from the quiz form.

    For example. There is a textbox called username.

    What is the syntax for accessing the value of username from the results page?

    Please please please help me.

    Kind Regards

  2. #2
    Join Date
    Mar 2004
    You can't is the short answer. The post method sends the variables as part of the http request headers. The server does not return the headers so the variables are not returned.

    You can use the get method to send since the variables are still in the query string of the URL. But a more private method might be to set the variables to a cookie. Then the new page can read from the cookie.

    The most correct way is don't actually submit the form at all. When they click submit, run the form validation/marking script imediately (include the script with the first page) then use a Alert to popup the score. When they click OK, they can be diverted to a try again or congratulations page of your choice. Since the page never has to reload, you don't have to pass the variables using any method at all.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts