Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Javascript
Javascript Confirm popup Yes, No button instead of OK and Cancel in asp.net
Posted 7-Jan-13 22:54pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

This is not a question, it's a demand we do your work for you. The standard popups say OK and Cancel. There's all sorts of jquery libraries that give nicer looking popups and give you control over things like what the buttons say, or you can create your own HTML popup window that shows anything you like.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

  Permalink  
Comments
Member 10726434 at 6-May-14 17:34pm
   
adsfasdasdasdasdasd
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

This is your homework. Here we can guide you only.
You need to use JQuery plugins.
Here is a jQuery Plugin Confirm Box[^]: jDialog. You can basically skin it the way you like with CSS. Or, you can use jQuery UI's[^] modal box.
 
--Amit
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 6

The person/team lead who approved this task for you must be fired.. He must know that the Javascript Confirm button texts cannot be changed...
 
If you want your custom dialogs, then you can create them very easily using HTML and javascript or jQuery.. Check here http://jqueryui.com/dialog/[^]
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 7

Create your own confirm box:
 
<div id="confirmBox">
    <div class="message"></div>
    <span class="yes">Yes</span>
    <span class="no">No</span>
</div>
 

Create your own confirm() method:
 
function doConfirm(msg, yesFn, noFn)
{
    var confirmBox = $("#confirmBox");
    confirmBox.find(".message").text(msg);
    confirmBox.find(".yes,.no").unbind().click(function()
    {
        confirmBox.hide();
    });
    confirmBox.find(".yes").click(yesFn);
    confirmBox.find(".no").click(noFn);
    confirmBox.show();
}
 

Call it by your code:
 
doConfirm("Are you sure?", function yes()
{
    form.submit();
}, function no()
{
    // do nothing
});
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 5

function validate() {
          var comments = document.getElementById("<%=txtComments.ClientID%>");
          if (comments.value == "") {
              var cmt = confirm('Do you want to proceed without entering any comments?');
              if (cmt == true) {
                  return true;
 
              }
              else {
                  comments.focus();
                  return false;
              }
 

 
          }
          return true;
 

      }
      function confirm(str) {
          execScript('n = msgbox("' + str + '","4132")', "vbscript");
          return (n == 6);
      }
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 274
1 Shweta N Mishra 216
2 PIEBALDconsult 210
3 Sergey Alexandrovich Kryukov 185
4 BillWoodruff 174
0 OriginalGriff 7,620
1 Sergey Alexandrovich Kryukov 6,937
2 DamithSL 5,586
3 Manas Bhardwaj 4,946
4 Maciej Los 4,495


Advertise | Privacy | Mobile
Web04 | 2.8.1411023.1 | Last Updated 3 Mar 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100