dialogX: Display alert, confirm and prompt dialog boxes

Recommend this page to a friend!
     
  Info   Example   View files Files   Download Download   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2025-07-09 (5 hours ago) RSS 2.0 feedNot yet rated by the usersTotal: 103 All time: 405 This week: 4Up
Version License JavaScript version Categories
dialogx 1.0Freeware5HTML
Description 

Author

This object can display alert, password, confirm and prompt dialog boxes.

It can generate HTML to display dialog boxes of several types to prompt the user for several types of interactions.

It may call a given callback function once the user interacts with the dialog box.

Picture of Harcharan Singh
Name: Harcharan Singh <contact>
Classes: 4 packages by
Country: India India
Age: 33
All time rank: 11011 in India India
Week rank: 6 Up1 in India India Up
Innovation award
Innovation award
Nominee: 2x

Example

<!DOCTYPE html> <html> <head> <title>Dialog X</title> <link rel="stylesheet" type="text/css" href="dialogX.css"> </head> <body> <button onclick="dialogX.password({ message: 'Verify your password?<br>Correct password is <b>000</b>.', buttonText: 'Verify', title:false }, function (e) { if (e.value == '000') { e.close(); } else { e.malformed(); } })">Verify Password</button> <button onclick="dialogX.alert({ message: 'JavaScript is the <i>programming language</i> of <b>HTML</b> and the Web.', buttonText: 'Got It!', title:'Info' })">Alert</button> <button onclick="dialogX.confirm({ message: 'What is your age group?', buttons: 3, buttonText: ['13+', '21+', '60+'], title:false }, function (i) { var clicked = '13+'; switch (i) { case 1: clicked = '21+'; break; case 2: clicked = '60+'; break; } dialogX.alert({ message: 'Your <i>age group</i> is <b>'+clicked+'</b>.', buttonText: 'OK', title:'Info' }); })">Confirm</button> <button onclick="prompt()">Prompt</button> <button onclick="dialogX.custom()">Custom</button> <script src="dialogX.js"></script> <script type="text/javascript"> function prompt() { dialogX.alert({ message: 'We are sorry. Currently <i>prompt</i> is under <b>development</b>.', buttonText: 'OK', title:'Info' }); } dialogX.custom = function () { var instance = this; var message = document.createElement('div'); message.className = 'dialogX-custom'; var p = document.createElement('p'); p.className = 'dialogX-custom-content'; p.innerHTML = "Hello, i m <b>custom</b> <i>dialog box</i>."; message.appendChild(p); var button = document.createElement('button'); button.className = 'button button-2'; button.innerHTML = 'Okay'; message.appendChild(button); var container = dialogX.decorator.container(); container.appendChild(message); container = dialogX.decorator.draw(this, container); button.addEventListener('click', function () { instance.enableScreen(true, container); instance.enableScreen(); }, false); }; </script> </body> </html>

Details

DialogX

Create custom alert, confirm and prompt box.

Usage

see example.html


  Files folder image Files (5)  
File Role Description
Accessible without login Plain text file dialogX.css Data Auxiliary data
Plain text file dialogX.js Class Class source
Accessible without login Plain text file example.html Example Example
Accessible without login Plain text file LICENSE Lic. License
Accessible without login Plain text file README.md Data Auxiliary data

 Version Control Unique User Downloads Download Rankings  
 100%
Total:103
This week:0
All time:405
This week:4Up