Java Coder
javascript prompt alert
3 Answer(s)      5 years and 5 months ago
Posted in : JavaScript Questions

Sending a prompt alert using a JavaScript function..


View Answers

September 26, 2011 at 12:19 PM

JavaScript Alert box - you can also call it interactive boxes. As these alerts make a simple communication between the application and it's user. For example if a user enters a wrong password or ID then it need to be restricted to access the page. But the question is, how a user will understand that he/she is a unauthorized user?

The answer is "JavaScript Prompt Alert" it will tell the user that you are unauthorized. Find the given code that explains how to create a prompt alert in your JavaScript application.

string prompt =
     "<script type=\"text/javascript\">alert('This Alert for an unauthorized user'); </script>";
       ClientScript.RegisterStartupScript(typeof (Page), "alert", prompt);

September 26, 2011 at 12:54 PM

Javascript Alert box:

    <script type="text/javascript">
    function show()
    alert("This is an alert box!");

    <input type="button" onclick="show()" value="Show alert box" />


September 26, 2011 at 12:57 PM

Javascript prompt box:

<script type="text/javascript">
function show()
var name=prompt("Enter your name","");
alert("Hello " + name + "!");

<input type="button" onclick="show()" value="Show prompt box" />


Related Tutorials/Questions & Answers:
javascript prompt alert
javascript prompt alert   Sending a prompt alert using a JavaScript function
javascript for prompt - JSP-Servlet
javascript for prompt  Dear Sir, I am using a prompt() for taking... a prompt contains any special character or what.If contains a alert message has to come toremove a special character.I done but when an alert message come press ok
javascript for prompt - JSP-Servlet
javascript for prompt  Dear sir, I am using prompt()for taking a reason from vendor . var reason=prompt('Reason for deleting:',''); Then i... an alert message.I done the following if(reason.length>256){ alert("Value
javascript for prompt - JSP-Servlet
javascript for prompt  Dear sir, I have used prompt() for taking a reason while deleting using java script its working fine but prompt was coming at the top left so i want that prompt should come at middle so how to do
Javascript alert message
Javascript alert message   How to send an alert message to a user in JavaScript
javascript statement alert
javascript statement alert  JavaScript Alert If Statement   JavaScript Alert if Statement <script type="text/javascript"> <...;/script> JavaScript Alert else if Statement <script type="text/javascript
JavaScript Alert YES NO
JavaScript Alert YES NO  How to send an alert to a user to confirm if there request is valid or not? I wants to send the alert message in Java Script... type="text/javascript"> function show_alert(my_string) { alert(my_string
JavaScript display variable in alert
JavaScript display variable in alert  How to display variable in alert box? I am using javascript.   <html> <head> <script type="text/javascript"> function showAlert() { var name = "Roseindia
javascript for textbox or prompt using servlet - JSP-Servlet
javascript for textbox or prompt using servlet  Dear sir, I am using a prompt(),when a delete is confirmed,its working fine ,but when a prompt is closed or cancel ,i have to remain in the same page but here it is going
javascript for textbox or prompt using servlet - JSP-Servlet
javascript for textbox or prompt using servlet  Dear sir I am writing script in servlet,so prompt() is not working here so please help me...\"){"); out.println(" var reason=prompt('Reason for deleting
into methods in the method asking for the input it uses a prompt command...) { System.out.print(**prompt** + ' '); return numberOfGrades } I don't undersant the prompt part
alert  after pressing ok button in alert message it has to stop...; if(username==""){ alert("Enter Username!"); return false; } if(password==""){ alert("Enter Password!"); return false; } return true; } </script> <
JavaScript Pop Up Boxes
JavaScript Pop Up Boxes JavaScript has three kind of pop-up boxes,  i)    Alert-Box: If some surety is required from the user or an alert message is to generate then we can use alert box, user has to click ok
prompt using
prompt using  I want examples to use prompt and how to move the item from the prompt to a cell in a table. thank you
using prompt
using prompt  how to use prompt
Display alert box on clicking link
a "a href" link. On clicking this link ,a alert box prompt message.... We have used the JavaScript alert() function to display the message. Here...Display alert box on clicking link In this tutorial, we will display alert box
Command Prompt in UI
Command Prompt in UI  Hi One Help... Please go through. I want to develop like that using jsp/javascript but nothing is striking in mind... Please give some suggestions to design first Thanks in advance---- Vanchinathan.R
What is a prompt box?
What is a prompt box?  What is a prompt box
alert for validation
alert for validation  i want to put alert on the text box that enter data should be in DD/MM/YYYY format only through javascript validation.    <html> <script type='text/javascript'> var
alert in jsp
alert in jsp  if(pass.equals(pwd)) { Statement st1..."); %> alert("password is successfully changed"); <... Password"); %> <script> alert("please enter old Password
Alert in Servlet
Alert in Servlet  <p>Hi</p> <p>I want to delete record from oracle db, i need alert message saying 'Are you sure you want... of each row, when i click delete it shd alert me....This is my servlet code:<
Command Prompt in UI
Command Prompt in UI  Hi, Is there any API or JAR file for running all the windows command prompt commands like dir,echo,ping commands? If any please tell me what is it? Thanks & Regards---Vanchinathan.R
command prompt is compilation is not working
command prompt is compilation is not working   Dear java users can anyone help me to run the program in command line prompt i tried by selecting... helloworld through command prompt class not found error and class loader not able
How to prompt user
How to prompt user  Dear Sir, I'm a new student, a beginner in Java. Pls help to write program as below :- a)to prompt user to input 2 integers, the 1st number entered as Digit 1 and 2nd number as Digit 2. b)Display the value
change appearance of alert box
change appearance of alert box  how to change the appearance of an alert() box
Information Save Alert
Information Save Alert  Hi, Sir I am creating a web page there user can edit their information. I want a javascript that can show an alert message when user edit the information and trying to close or go to another page without
jQuery alert()
jQuery alert() In this jQuery tutorial we will discuss how an alert box works in jQuery. Moreover, this tutorial will discuss in details about alert box in jQuery. In the given application here, alert boxes have been used to provide
JSP Alert
JSP Alert          JSP Alert is used to put the validation on login... the validation on the login form using Javascript method in JSP page.  Understand
GETTING ALERT MESSAGE  how to get an alert message when radio button is selected instead of checkbox
Prompt for a password when deleting a data
Prompt for a password when deleting a data  I am using netbeans and mysql. i have added a username and password. i have a set of data in the database. so when deleting a data it should prompt for the password and if the password
GETTING AN ALERT MESSAGE  how to get an alert message, if i select radio button instead of checkbox(associated with 3 dropdown list