HTML Forms and Java Script


Summary

CALL; HTML forms; Java Script; Exercise formats (multiple choice, fill in the blank, etc.); Blackboard & Co.; More bells and whistles with JavaScript.


Homework

HW # 3 (due end of Week 4): Part 1: Create two Web pages each with ten exercise tasks and each with a different exercise format, Part 2: Design a Web page with dynamic multimedia content using tables and OnMouseOver/OnMousOut function. E-mail the links to all these pages to me.


Resources

There are ample HTML primers on the Web, e.g.:

CWRU Tutorial | NCSA Tutorial | MCLI Tutorial

More advanced in-depth information is available at the W3C Pages
Another useful resource is the Yale Web Style Guide


Examples

Various on-line excercises you can use as templates are located at the:

Turbo Serbo Excercises Page

Here are several commented examples of minimal on-line excercises formats:

Web pageSource
Fill-in format one PageFill-in format one Source
Fill-in format two PageFill-in format two Source
Multiple choice format one PageMultiple choice format one Source
Multiple choice format two PageMultiple choice format two Source
Send-in PageSend-in Source


And now, something completely different. Look at the wild stuff you would be able to make:

Go here and pick up one of the animated gif creators.

You can also use animated applets. Click here to get Applets Effects Factory, which will make possible to create animated applets.


Here is a simple Fahrenheit <-> Celsius converter:

Enter a number in either C or F field and click outside that field.

F:
C:

This is what you have to use:

Enter a number in either C or F field and click outside that field.
<FORM>F: <INPUT onchange="C.value = 100/(212-32) * (this.value - 32 )" name=F> 
<BR>C: <INPUT onchange="F.value = (212-32)/100 * this.value + 32 " name=C> 
</FORM>

Change these fields to obtain other converters:

There are also numerous Java Script Tutorials on the web, for example: Concise guide for programmers | General intro with examples


Here is a commented java script which calculates your score and opens a new window to write both score and the mistakes, which you could use to print it out or send to your teacher.

Web pageSource
Java script PageJava script Source

Click here for an example of the window which pops up as you click on a button. The source code is as follows

<html>
<head>
<script>
function popit () {
newwindow=window.open("dude.gif","","width=20,height=20");
}
</script>
<head>
<body>
<form>
<input type="button" value="Drawing" onClick="popit()">
</form>
</body>
</html>

Here is an example of a freeware which will allow you to create JavaScript menus.


Examples

Last year's test 1, Last year's test 2