Forms - passing data from a form to another web page.


As well as sending information to a back-end server, a Web page form can also send its data to another web page. The receiving page gets the same Submit string as a server-side program would, containing a name=value pair for each control on the first page's form. This string can be accessed as the system property 'location.search' by scripts within the receiving page.

Try filling in the form below, then pressing the Submit button. A new page, 'formrec.htm', will appear, which shows the raw location.search string, and breaks the string down into individual data names and values. Formrec.htm can accept a string from any page, so you can use it to test your own forms. You can also copy the JavaScript routines I've written in formrec.htm, which breakthe string down (though please leave my copyright statements intact!).


Test Form

Here's the test form - try it, see the results in formrec.htm, then compare them with the HTML statements which define the form controls in this page. Try submitting this form with different options (in particular, check different boxes and select differeing numbers of options from the scrolling list), then see how that affects the data string that's sent to formrec.htm.

DON'T FORGET - INTERNET EXPLORER WON'T PASS FORM DATA BETWEEN PAGES WHEN THEY'RE BEING LOADED FROM LOCAL DISKS (INCLUDING CD-ROMS). EITHER LOAD THIS PAGE IN NETSCAPE NAVIGATOR, OR IF YOU DON'T HAVE NAVIGATOR INSTALLED, TEST IT IN IE FROM MY WEB SITE AT http://web.ukonline.co.uk/paul.stephens/index.htm.

Your name:

Are you: Male Female.

Is your age:

Check the magazines you read: PC Plus PC Answers PC Guide Other magazines

Which types of applications do you use (select as many as you like)?

TIP - Use CTRL-Click to select multiple items

Do you use a PC at Work Home

What are your comments about PC Plus?

Thank you for filling in this form - now press the Submit button to see the results.


Return to menu