Displays and monitors the most used dialog boxes : Dialog « Window Browser « JavaScript DHTML

JavaScript DHTML
1. Ajax Layer
2. Data Type
3. Date Time
4. Development
5. Document
6. Event
7. Event onMethod
8. Form Control
9. GUI Components
10. HTML
11. Javascript Collections
12. Javascript Objects
13. Language Basics
14. Node Operation
15. Object Oriented
16. Page Components
17. Security
18. Style Layout
19. Table
20. Utilities
21. Window Browser
Microsoft Office Word 2007 Tutorial
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
C# / C Sharp
C# / CSharp Tutorial
ASP.Net
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
PHP
Python
SQL Server / T-SQL
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
JavaScript DHTML » Window Browser » Dialog 
Displays and monitors the most used dialog boxes

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>

  <HEAD>
    <TITLE>JsLib 1.3 - Exemple - dialogues.js</TITLE>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
    <META NAME="Author" CONTENT="Etienne CHEVILLARD">
    <!-- dialogues.js -->
    <SCRIPT TYPE="text/javascript" LANGUAGE="Javascript">
/* dialogues.js
 * Role : affiche et controle les boites de dialogue les plus utilisees
 * Projet : JsLib
 * Auteur : Etienne CHEVILLARD (echevillard@users.sourceforge.net)
 * Version : 1.3
 * Creation : 12/07/2001
 * Mise a jour : 23/02/2005
 * Bogues connues : - le dialogue d'impression n'apparait pas sous Opera 5
 */

// --- Fonctions ---

// affiche une boite de dialogue de confirmation et retourne la reponse choisie
function dialogueConfirm(message) {
  if (!message) { message="Confirmation"}
  return (window.confirm(message));
// fin dialogueConfirm(message)

// affiche la boite de dialogue d'impression de la page Web courante
function dialogueImprimer() {
  if (window.print) {
    if (window.focusself.focus();
    self.print();
  else {
    var dagt=navigator.userAgent.toLowerCase();
    if ((dagt.indexOf("msie")!=-1&& (dagt.indexOf("opera")==-1)) {
      var dimp="<OBJECT ID='WindowPrint' WIDTH=0 HEIGHT=0 CLASSID='CLSID:8856F961-340A-11D0-A96B-00C04FD705A2'></OBJECT>";
      document.body.insertAdjacentHTML("beforeEnd", dimp);
      WindowPrint.ExecWB(62);
    }
  }
  return true;
// fin dialogueImprimer

// affiche une boite de dialogue d'information
function dialogueInfo(message) {
  if (!message) { message="Information"}
  window.alert(message);
  return true;
// fin dialogueInfo(message)

// affiche une boite de dialogue de saisie et retourne le texte saisi
function dialogueSaisie(message, defaut) {
  var drep;
  if (!message) { message="Saisie"}
  if (!defaut) { defaut=""}
  drep=window.prompt(message, defaut);
  if (!drep) { drep=""}
  return (drep);
// fin dialogueSaisie(message, defaut)
    
    </SCRIPT>
  </HEAD>

  <BODY>
    <H1>JsLib 1.3</H1>
    <HR>
    <H2>Exemple - dialogues.js</H2>

    <NOSCRIPT>
      <P><I>Erreur : votre navigateur ne reconnait pas le Javascript ou est configur&eacute; pour ne
      pas prendre en compte le code Javascript. Dans ce dernier cas, vous pouvez modifier la
      configuration dans les pr&eacute;f&eacute;rences/options de votre navigateur.</I>
      <HR>
    </NOSCRIPT>

    <FORM ACTION="GET" NAME="f1" onSubmit="return false">
    
      <P>Bo&icirc;te de dialogue de saisie :<BR>
        <INPUT TYPE=BUTTON VALUE="Saisie du pr&eacute;nom" onClick="this.form.t1.value = dialogueSaisie('Indiquez votre pr&eacute;nom :', 'Toto')">

      <P>Bo&icirc;te de dialogue d'information :<BR>
        Votre pr&eacute;nom : <INPUT TYPE=TEXT NAME="t1" VALUE="Toto">
        <INPUT TYPE=BUTTON VALUE=" OK " onClick="dialogueInfo('Bonjour ' + this.form.t1.value + ' !')">

      <P>Bo&icirc;te de dialogue de confirmation :<BR>
        <INPUT TYPE=BUTTON VALUE="Page pr&eacute;c&eacute;dente" onClick="if (dialogueConfirm('Voulez-vous revenir &agrave; la page pr&eacute;c&eacute;dente ?')) history.back()">

      <P>Bo&icirc;te de dialogue d'impression :<BR>
        <INPUT TYPE=BUTTON VALUE="Imprimer la page" onClick="dialogueImprimer()">

    </FORM>
    
  </BODY>
</HTML>


           
       
Related examples in the same category
1. Dialog in JavaScript
2. Open a dialog window
3.  String Object's Length, Document.Location Properties, confirm and input dialog
4.  Working with the Alert, Confirm, and Prompt Methods
5. Alert box (dialog) with line-breaks
6. Button click to display dialog
7. Pop-up Window - centred
8. Display a confirm box (dialog)
9. Display a prompt box (dialog)
10. Confirm Dialog Box
11. The Prompt Dialog Box: check the return result
12. Document for the Modeless Dialog Box
13. Use prompt for password checking
14. User input
15. Yes/No Confirmation
16. Non string parameter for alert()
17. Dialog Box Demo
18. Alert Window
19. Main Page for show Modeless Dialog
20. Document for the Modal Dialog
21. Main Page for show Modal Dialog
22. Create a pop-up
23. Alert Dialog
24. Prompt Input Dialog
ww_w__.ja___v__a_2__s_._com | Contact Us
Copyright 2003 - 08 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.