Basic HTML version of Foils prepared 23 June 1997

Foil 60 JavaScript Form Example

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


The following example illustrates some simple form elements with onFocus and onClick event handlers:
<form>
<input type="text" name="data" size=30
onFocus="window.status='this is a test of onFocus'; return true">
<input type="submit" value="clickit!" onClick="top.dosomething('This is a test of onClick')">
</form>
window.status is a property holding message at bottom of browser window
One would typically have onChange handler as well in text field. Note that with these handlers one does NOT necessarily need server-side CGI script to process form



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