Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JavaScriptQuestions javascript confirm yes no
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Java Coder
javascript confirm yes no
3 Answer(s)      2 years and 6 months ago
Posted in : JavaScript Questions


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


Advertisement
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
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
Advertisements
javascript confirm box
javascript confirm box  javascript confirm box
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
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
yes
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
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
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
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
[[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 insert Question -
JAVASCRIPT insert Question  It is easy to transmit information from HOST program (in my case PHP program) to JAVASCRIPT insert. How may I reverse this, passing YES/NO information from a CONFIRM BOX back to the PHP program
JavaScript Pop Up Boxes
JavaScript Pop Up Boxes JavaScript has three kind of pop-up boxes,  i... button to proceed. ii)    Confirm Box: This  box is used when...: Example 2 (Confirm Box): <html> <head> <script type="
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
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
JavaScript  clone JavaScript
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
javaScript  How to open a browser window that cannot be resized? (HTML + Javascript
javascript
javascript  write a program to display implement about browsers using javascript
javascript
javascript  Hi deepak, how to write form validation on javascript
JavaScript
JavaScript  how to get full path of a file type in 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  i have just learned javascript... can you tell me what kind of applications can be made by javascript?? thank you
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  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  how to set the request or session attribute in javascript head part of jsp page
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
Advertisements
 

 

 

DMCA.com