Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



Popup Boxes in JavaScript

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 21-01-2010
Member
 
Join Date: Jan 2009
Posts: 74
Popup Boxes in JavaScript
  

Hello, I am learning java script. Recently I had read the pop box examples in java script from my book. But, I am not able to get the exact idea about it. If anyone is having details about it, then please provide me that. Please provide me some scripts if you have. So, that I can able to get idea about the use of it.

Reply With Quote
  #2  
Old 21-01-2010
Member
 
Join Date: Apr 2008
Posts: 1,947
Re: Popup Boxes in JavaScript

JavaScript Provides you three types of Popup Box:
  • Alert box
  • Confirm box
  • Prompt box
Alert box : Aletbox is quiet similar with the message box in the vb script. It will be used to make sure for getting input from the user. It also provide the OK button for further continue.

Confirm Box : This Box contains the Ok and Cancel button. If use clicks on the cancel the box will return the false value. If user clicks on the Ok then true value is returned.

Prompt Box : This box contains the OK and cancel button. If user is inputting the value then you can provide this box to user.
Reply With Quote
  #3  
Old 21-01-2010
Member
 
Join Date: May 2008
Posts: 2,007
Re: Popup Boxes in JavaScript

JavaScript provides following types of Popup Boxes:

1)Alert Box: This is just for surarity of input.
Syntax:
Code:
alert("Add text Here");
2)Confirm Box: It will verify or get some input.
Syntax:
Code:
confirm("Add text Here");
3)Prompt Box: This is used to input value before page submission.
Syntax:
Code:
prompt("Add text Here","By Deault Value");
Reply With Quote
  #4  
Old 21-01-2010
Member
 
Join Date: Apr 2008
Posts: 2,000
Re: Popup Boxes in JavaScript

It can be possible to use the three different types of Popup boxes withe the help of java script:
ALERT BOX :
  • When user click on OK, he can go further.
  • Mostly used to make sure that the input is provided by the user or not.
  • It can be used to provide the warning message.
CONFIRM BOX:
  • When user click on OK or Cancel, he can perform further task.
  • Mostly used to verify the input from the user.
  • It will ask you further processing cab be done or not.
PROMPT BOX:
  • When user click on OK or Cancel, he can perform further task.
  • Mostly used to provide information to the user.
Reply With Quote
  #5  
Old 21-01-2010
Member
 
Join Date: May 2008
Posts: 2,291
Re: Popup Boxes in JavaScript

If you are using Java Script then it may provide you three types of Pop Boxes as below:
  1. Alert box :alert("Message");
  2. Confirm box :confirm("Message");
  3. Prompt box :prompt("Message","Deault Value");
Reply With Quote
  #6  
Old 21-01-2010
Member
 
Join Date: May 2008
Posts: 2,383
Re: Popup Boxes in JavaScript

Popbox script:
Alert Box:
Code:
<html>
<head>
<script type="text/javascript">
function alertexample()
{
alert("Got the message");
}
</script>
</head>
<body>
<input type="button" onclick="alertexample()" value="Show alert box" />
</body>
</html>
Confirm Box:
Code:
<html>
<head>
<script type="text/javascript">
function confirmexample()
{
var check=confirm("Press ");
if (check==true)
  {
  document.write("Ok pressed!");
  }
else
  {
  document.write("Cancel pressed ");
  }
}
</script>
</head>
<body>
<input type="button" onclick="confirmexample()" value="Show confirm box" />
</body>
</html>
Prompt Box:
Code:
<html>
<head>
<script type="text/javascript">
function promptexample()
{
var msg=prompt("Message");
if (msg!=null && msg!="")
  {
  document.write("Got message");
  }
}
</script>
</head>
<body>
<input type="button" onclick="promptexample()" value="Show prompt box" />
</body>
</html>
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Popup Boxes in JavaScript"
Thread Thread Starter Forum Replies Last Post
How to use CSS content boxes Botan Software Development 1 08-01-2011 11:18 AM
Why does popup blocker in windows 7 not stop netflix popup ads? Braasch Operating Systems 6 11-08-2010 12:33 PM
How to nest boxes inside parent boxes in CSS? Dilbert Software Development 5 11-05-2010 04:41 PM
How to Use Combo Boxes in Java? MarceloQuad Software Development 5 11-02-2010 02:23 AM
How to Open Popup Window in Javascript? Soumen Software Development 4 07-02-2010 03:02 AM


All times are GMT +5.5. The time now is 03:56 AM.