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.

View Answers

April 7, 2012 at 12:41 PM

You can use the confirm() method in Java Script.

if (confirm('Are you sure you want to save this thing into the database?')) {
    // Save it!
} else {
    // Do nothing!
}

April 7, 2012 at 12:54 PM

<html>
<head>
<script type="text/javascript">
function show_alert(my_string)
{
alert(my_string);
}
</script>
</head>
<body>

<input type="button" onclick="show_alert('This will alert!')" value="Show alert box" string="alert for system number 2" />

</body>
</html>









Related Tutorials/Questions & Answers:
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 confirm yes no
javascript confirm yes no  javascript confirm yes no - how to create confirm dialog box yes or no in JavaScript?   if (confirm('Are You... are not redirected") }   How to confirm yes or no in JavaScript
Advertisements
Javascript alert message
Javascript alert message   How to send an alert message to a user in JavaScript
javascript prompt alert
javascript prompt alert   Sending a prompt alert using a JavaScript function
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 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
alert
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> <
yes
ModuleNotFoundError: No module named 'yes'
ModuleNotFoundError: No module named 'yes'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'yes' How to remove the ModuleNotFoundError: No module named 'yes' error
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 to delete?' with yes and no buttons, if yes, the data should delete if no control
Javascript
Javascript   Javascript to check Numeric entry in checkbox.....  ... in javascript function validateBox(){ var data=document.myForm.someText.value; if(data=="" || data==null){ alert("Please Input Data
Javascript
this format xxx-xxx-xxxx, i want the code in javascript. as a function.   Javascript Phone Number Validation <html> <script> function...)-(\d\d\d)-(\d\d\d\d)/; if(ph==""){ alert("Enter Phone Number!"); } else
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
fast view web--yes - Struts
fast view web--yes  How to enable the fast web view--yes on pdf file  Hi Friend, Please clarify your problem. Thanks
Yes/No confirm box with vbscript - Framework
Yes/No confirm box with vbscript  I'm using a Yes/No confirmation with vbscript. But the in the confirm box, the titiel is coming along with 'VBScript' in it. I just want to remove this 'VBScript' title, Can anyone help me
javascript validation
javascript validation  i have 4 buttons in my project like save,find,modify,clear and exit. Here my problem is i have to validate in javascript like if i click on save button an alert message should be displayed "DO YOU WANT
Javascript
/javascript"> function validateForm() { var sname=document.getElementById('spocname...<10){ alert('enter min 10 characters'); sname.focus(); } if(scontact.value.length>10){ alert('enter less than 10 characters'); scontact.focus
JavaScript
JavaScript  clone JavaScript
alert in jsp
alert in jsp  if(pass.equals(pwd)) { Statement st1..."); %> alert("password is successfully changed"); <... Password"); %> <script> alert("please enter old Password
javascript
javascript  Hi deepak, sample example on javascript form validation...)){ return 1; } else{ alert("Please enter a valid name. The only charachters...) { if(isNaN(text)){ return 1; } else{alert("Please enter a valid address. The only
javascript
javascript  javascript code to dynamically add table on button click.../javascript/javascriptexamples/javascript-add-row-dynamically.shtml http://www.roseindia.net/javascript/javascript-add-row-to-table.shtml http://www.roseindia.net
javascript
why += checkRadio(theForm.radios); if (why != "") { alert(why); return false
Javascript
Javascript  How validations are done using javascript ,with example? and interview questions on javASCRIPT
javascript
(theForm.radios);ADS_TO_REPLACE_2 if (why != "") { alert(why); return false...); var checkR = checkRadio(document.f1.radios.value); if (checkD != "") { alert(checkD); return false; } if (checkR != "") { alert(checkR); return false
JavaScript
should use JavaScript? Thanks   Hi, JavaScript is scripting language that runs on browser. You have to embed JavaScript in HTML page. Please see JavaScript tutorial. Thanks
JavaScript
JavaScript  how to get full path of a file type in javascript
javascript
javascript  Hi deepak, how to write form validation on javascript
javascript
javascript  write a program to display implement about browsers using javascript
javaScript
javaScript  How to open a browser window that cannot be resized? (HTML + Javascript
javascript
javascript  i have just learned javascript... can you tell me what kind of applications can be made by javascript?? thank you
javascript
javascript  how to set the request or session attribute in javascript head part of jsp page
javascript
javascript  Hi sir, This is sinduri, i want to learn javascript, so plz can u help me.how to learn
javascript
javascript  hi sir, if i want to learn javascript. what concepts i want to know
JAVASCRIPT
JAVASCRIPT  I have one textbox and I want to validate that it must start with number(1-0). can anyone tell me a javascript for that ? thanks in advance
[[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO] is depricated
[[UIApplication sharedApplication] setStatusBarHidden:YES animated... the status bar hidden. [[UIApplication sharedApplication] setStatusBarHidden:YES...: [[UIApplication sharedApplication] setStatusBarHidden:YES]; Thanks
javascript
javascript  hi, I was actually working on to calculate the number of days between two dates of yyyy-mm-dd format using javascript, and when i click on button then number of days should be display in textbox
javaScript
javaScript  . Print a table like below in JAVASCRIPT 5 x 1 = 5 5 x 2 = 10 ΓΆβ?¬Β¦ΓΆβ?¬Β¦ΓΆβ?¬Β¦. 5 x 20 = 100
javascript
javascript  passing javascript values to jsp   Hi Friend, Try the following code:ADS_TO_REPLACE_1 form.jsp: <html> <script>... Javascript value In JSP"> <% String st=request.getParameter("msg"); if(st
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
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
change appearance of alert box
change appearance of alert box  how to change the appearance of an alert() box
Javascript
Javascript  Dear Sir, Thank You a lot for your continuos support.Again i am in need of your help. What is the javascript code to disable a link,once... javascript or css Please help me.Urgent Regards Debasis   Hello Friend
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
javascript for textbox - JSP-Servlet
javascript for textbox  Dear sir , How to write a javascript... that record should be deleted before deleting it an alert message is shown... a javascript to do so ..Please help me sir... Thanks...  Hi Friend, Try
javascript
=document.form.tfee.value; alert(average); if(average>=95) { discount="100%"; total=0; } else
javascript
=document.form.tfee.value; alert(average); if(average>=95) { discount="100%"; total=0; } else
javascript
javascript  how to create random question using javascript?   <html> <script> function displayQuestions() { document.getElementById("text").value=" "; var Questions = new Array(20
GETTING ALERT MESSAGE
GETTING ALERT MESSAGE  how to get an alert message when radio button is selected instead of checkbox
jQuery Hello World alert
display "Hello World" alert box using jQuery. This application will use the JavaScript alert() method to display the "Hello World" message...jQuery Hello World alert example    
ModuleNotFoundError: No module named 'alert'
ModuleNotFoundError: No module named 'alert'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'alert' How to remove the ModuleNotFoundError: No module named 'alert'

Ads