Basic HTML version of Foils prepared 23 June 1997

Foil 10 JavaScript Form Example - I

From JavaScript Tutorial for Certificate Course UC Web applications Certificate -- Summer 97. by Geoffrey C. Fox, Tom Scavo

some alert examples for Foil 10
1 <HTML><HEAD><TITLE>JavaScript with Forms</TITLE>
2 <SCRIPT LANGUAGE="JavaScript">
3 <!-- a comment to hide JavaScript from old browsers
4 function compute(form) {
5 if (confirm("Is this what you want?"))
6 form.result.value = eval(form.expr.value);
7 else alert("Enter a new expression then!");
8 }
9 // end script hiding -->
10 </SCRIPT></HEAD>
11 <BODY><FORM>
12 Enter an expression:
13 <INPUT TYPE="text" NAME="expr" SIZE=15>
14 <INPUT TYPE="button" VALUE="DoIt!" ONCLICK="compute(this.form)">
15 <BR>Result: <INPUT TYPE="text" NAME="result" SIZE=15><BR>
16 </FORM></BODY></HTML>

in Table To:


Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Wed Apr 1 1998