Working with the Alert, Confirm, and Prompt Methods : 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 
Working with the Alert, Confirm, and Prompt Methods

<HTML>
<HEAD>
<TITLE>Simple dialogs</TITLE>
<SCRIPT
   function showAlert(inText) { 
      alert (inText)
   
   function showConfirm(){ 
      if (confirm("True or False?"== true
         return "true" 
      else 
         return "false"
   
   function showPrompt(inText){ 
      var retVal = "" 
      retVal = prompt(inText, "FirstName LastName")
      if (retVal == "" || retVal == null
         return "nameless one"
      else 
         return retVal; 
   
   </SCRIPT>
</HEAD>
<BODY>
<FORM Name="theForm">
<TABLE cellspacing=5>
<TR>
<TD>
<INPUT Type=Text Name="alertText" Size=40>
<TD>
<INPUT Type=Button Value="Alert" onClick='showAlert(alertText.value);'>
</TR>
<TR>
<TD>
<INPUT Type=Text Name="decisionText" Size=40>
<TD>
<INPUT Type=Button Value="Confirm" onClick='decisionText.value=showConfirm();'>
</TR>
<TR>
<TD>
<INPUT Type=Text Name="nameText" Size=40>
<TD>
<INPUT Type=Button Value="Prompt" onClick='nameText.value = "Hello, " + showPrompt("What is your name?");'>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>
           
       
Related examples in the same category
1. Displays and monitors the most used dialog boxes
2. Dialog in JavaScript
3. Open a dialog window
4.  String Object's Length, Document.Location Properties, confirm and input dialog
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
w__ww___.___j___a__v___a__2__s__._co__m | Contact Us
Copyright 2003 - 08 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.