Fill a web document with web forms

T

Tadeo

I want to make a web with a form with some fields.
When the user submits they will generate a new web similar as this:

Mr. <Somebody>:
Your computer is <computer>
 
G

Grant Wagner

Tadeo said:
I want to make a web with a form with some fields.
When the user submits they will generate a new web similar as this:

Mr. <Somebody>:
Your computer is <computer>

-- page1.html

<body>
<form name="myForm" method="GET" action="page2.html">
Your name: <input type="text" name="theName">
<br>
Your computer: <input type="text" name="theComputer">
<br>
<input type="submit" name="submitButton" value="Submit">
</form>
</body>

-- page2.html

<body>
<script type="text/javascript">
if (/theName=([^&]*)/.test(window.location.search) && RegExp.$1) {
document.write('Mr. ' + RegExp.$1 + '.<br>');
} else {
document.write('No name supplied!<br>');
}
if (/theComputer=([^&]*)/.test(window.location.search) && RegExp.$1) {
document.write('Your computer is ' + RegExp.$1 + '.<br>');
} else {
document.write('No computer supplied!<br>');
}
</script>
</body>
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top