javascript confirm yes no

javascript confirm yes no

javascript confirm yes no - how to create confirm dialog box yes or no in JavaScript?

View Answers

March 29, 2012 at 12:32 PM

if (confirm('Are You Sure')){
   window.location = "http://www.roseindia.net/";
}else{
   alert("you are not redirected")
}

March 29, 2012 at 12:44 PM

How to confirm yes or no in JavaScript

There is confirm Box popup in JavaScript that can be used to get confirmation from user. For example if you wants to open a webpage get it confirm first. There must be two options in confirm box "ok" and "cancel". or may be yes or no.

Syntax to write confirm: confirm("yourMesg");

See the code below..

<html>
<head>
<script type="text/javascript">

function show_confirm()
{
var con = confirm("Are You Sure");
if (con ==true)
  {
  alert("You pressed OK!");
  }
else
  {
  alert("You pressed Cancel!");
  }
}

</script>
</head>
<body>

<input type="button" onclick="show_confirm()" value="Show confirm box" />

</body>
</html>

October 15, 2012 at 5:35 PM

showConfirm("Your message",<OnConfirmationCallingmethod>, 0, false);

Syntax: showConfirm("text",function, number/variable, boolean);









Related Tutorials/Questions & Answers:
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
JavaScript Alert YES NO
JavaScript Alert YES NO  How to send an alert to a user to confirm....   You can use the confirm() method in Java Script. if (confirm... type="text/javascript"> function show_alert(my_string) { alert(my_string
Advertisements
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 confirm box
javascript confirm box  javascript confirm box
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
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
JavaScript
JavaScript  clone JavaScript
Confirm problem
Confirm problem  Sir i have used following code in button delete onclick="if (confirm('sure?')) submit();" and if i choose cancel it still submits the form however if choose cancel i want to remain on same jsp page please help
javascript for textbox - JSP-Servlet
javascript for textbox  Dear sir , How to write a javascript... a javascript to do so ..Please help me sir... Thanks...  Hi Friend, Try...=confirm("Are you confirm"); if (r==true) { var reason=prompt("Reason
confirm delete
confirm delete  Sir, I want to ask confirmation before deletion, i m using submit button then the form is passed to servlet for deletion,Please help Thanks in advance
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
Javascript  How validations are done using javascript ,with example? and interview questions on javASCRIPT
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
confirm message box - Java Beginners
confirm message box  How can I create a confirm message with Yes... function showConfirm() { myBooleanVariable = newConfirm( 'My Confirm Title', 'My Confirm Message', 2,0,0) if (retVal==true) return true; else
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
Javascript
Javascript   Javascript to check Numeric entry in checkbox.....   Hi Please find the following code for numeric entry validation in javascript function validateBox(){ var data=document.myForm.someText.value
[[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
Javascript
this format xxx-xxx-xxxx, i want the code in javascript. as a function.   Javascript Phone Number Validation <html> <script> function..." method="post" onsubmit="javascript:return validate();"> Phone Number:<
javascript for textbox - JSP-Servlet
javascript for textbox  Dear Sir , Thanks for posting an answer, its..., height=350,toolbar=no,resizable=yes,menubar=yes'); In delete.jsp If i do...: function deleteRecord(id){ var r=confirm("Are you confirm"); if (r==true) { var
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
ModuleNotFoundError: No module named 'confirm'
ModuleNotFoundError: No module named 'confirm'  Hi, My Python... 'confirm' How to remove the ModuleNotFoundError: No module named 'confirm... to install padas library. You can install confirm python with following command
Javascript
Javascript  <html> <head> <script type="text/javascript"> function validateForm() { var sname=document.getElementById('spocname'); var scontact=document.getElementById('spoccontact'); if(sname.value.length
javascript
javascript
javascript  how to create random question using javascript?   <html> <script> function displayQuestions() { document.getElementById("text").value=" "; var Questions = new Array(20
javascript
javascript
javascript  Hi deepak, sample example on javascript form validation   <html> <script> function checkName(text) { if(isNaN(text)){ return 1; } else{ alert("Please enter a valid name. The only charachters
Servlets and confirm box
Servlets and confirm box  Sir...! I want to insert or delete records form oracle based on the value of confirm box can you please give me the idea.... thanks
Servlets and confirm box
Servlets and confirm box  Sir...! I want to insert or delete records form oracle based on the value of confirm box can you please give me the idea.... thanks
Servlets and confirm box
Servlets and confirm box  Sir...! I want to insert or delete records form oracle based on the value of confirm box can you please give me the idea.... thanks
javascript problem
javascript problem  hi guys My problem is that I am using radio button for yes or no but i want to do that if I press yes button then enter the text button inside the radio button if I press no button then no any other textbox
JavaScript Pop Up Boxes
JavaScript Pop Up Boxes JavaScript has three kind of pop-up boxes,  i... button to proceed.ADS_TO_REPLACE_1 ii)    Confirm Box: This ...;/head> </html> Output: Example 2 (Confirm Box):ADS_TO_REPLACE_3
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... TO ADD MORE DETAILS" if yes means go to dropdownlist and if no means go to save
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
Access denied for user 'abc'@'xxxx' (using password: YES)
Access denied for user 'abc'@'xxxx' (using password: YES)  I have tested my code on local machine DB, its working correctly.. But when i shifted it to server DB using URL, Username and password.. i got this error .. How can i
JavaScript types
JavaScript types  What are JavaScript types
ModuleNotFoundError: No module named 'odoo8-addon-procurement-mrp-no-confirm'
ModuleNotFoundError: No module named 'odoo8-addon-procurement-mrp-no-confirm...: ModuleNotFoundError: No module named 'odoo8-addon-procurement-mrp-no-confirm' How...-no-confirm' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'odoo8-addon-web-copy-confirm'
ModuleNotFoundError: No module named 'odoo8-addon-web-copy-confirm'  ...: No module named 'odoo8-addon-web-copy-confirm' How to remove the ModuleNotFoundError: No module named 'odoo8-addon-web-copy-confirm' error
ModuleNotFoundError: No module named 'django-email-confirm-la'
ModuleNotFoundError: No module named 'django-email-confirm-la'  Hi...: No module named 'django-email-confirm-la' How to remove the ModuleNotFoundError: No module named 'django-email-confirm-la' error? Thanks   

Ads