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
<HTML><HEAD><TITLE>JavaScript with Forms</TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!-- a comment to hide JavaScript from old browsers
function compute(form) {
if (confirm("Is this what you want?"))
form.result.value = eval(form.expr.value);
else alert("Enter a new expression then!");
}
// end script hiding -->
</SCRIPT></HEAD>
<BODY><FORM>
Enter an expression:
<INPUT TYPE="text" NAME="expr" SIZE=15>
<INPUT TYPE="button" VALUE="DoIt!" ONCLICK="compute(this.form)">
<BR>Result: <INPUT TYPE="text" NAME="result" SIZE=15><BR>
</FORM></BODY></HTML>



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