Richland College
ITSE 1311 Web Page Programming
Homework 9 --
Updated 9/23/2009 at 9:00 p.m.
Forms and JavaScript
-
Create an HTML form with at least these input elements in it:
- A text input field
- A textarea input field
- At least 3 radio buttons for whatever info you want from the user
- A submit button
You can be creative with the kinds of information you request from the user.
-
Save your form page as Form1.html
-
Put some JavaScript code in Form1.html, which displays the user's input when the
user clicks the submit button. Display the user's input in an alert
window.
- Hints:
- The phrase "When the user clicks the submit button" should suggest to
you an event.
- The onsubmit attribute/event handler is in the form tag.
- The phrase "Display the user's input in an alert window" should
suggest to you the
alert( ) built-in method.
- You can use the escape character sequence "\n" to put a newline (return)
into a JavaScript string that will be displayed to the screen in an "alert" popup window.
-
Add a hypertext link to the
index.html file that is in your class folder. Make this hypertext
link display the html page that you made for this assignment.
-
Validate your pages as XHTML 1.0 Transitional documents, using the
W3C XHTML Validator.
-
Test your pages to make sure they have no errors in them. (You should
turn on the display of script errors in your browser!) Here are some
instructions on how to turn
on JavaScript error messages.
-
Upload your files to your class folder. You will
need to use an FTP program to upload the files. You will find
some general FTP instructions on a page called "FTP
Instructions".