Dialog Boxes and Windows

CPT 106 · Franklin College · Erich Prisner · 2002-2006

alert("Text") and confirm("Text") create dialog boxes displaying the Text. The second one has two buttons ("OK" and "cancel") and becomes true if the user clicks "OK". Note also the flicker, due to the connection of the action to links with reloading. prompt("Text","Text") opens a dialog box with text field included.

Open a window with the flicker-free version.

Finally, and most conveniently perhaps, you can also attach the actions to a form:

 Have a look at the Javascript part. Discuss

 


Erich Prisner, December 2003