2

I have to display yes/no button on some condition on my asp.net page , I used windows.confirm() to display that but windows.confirm displays Ok/Cancel Button , Is there any way I can display Yes/No Button in asp.net page instead of Ok/Cancel using Javascript ?

RBS
  • 3,801
  • 11
  • 35
  • 33

6 Answers6

5

If you want to keep it simple, just check some of the jQuery or YUI plugins, you can get that up and running with a couple of lines of code.

For example, this one uses jQuery and this one uses YUI.

rodbv
  • 5,214
  • 4
  • 31
  • 31
0

http://bytes.com/groups/javascript/149838-yes-no-dialog-box-javascript

Read there :)

Filip Ekberg
  • 36,033
  • 20
  • 126
  • 183
0

You cannot change the button text on a JavaScript alert, and while you can't change them on a VBScript message box, it has different text. How I got around this was to develop a custom div that contains buttons with the correct text on them that is displayed using absolute positioning and a shadow effect to give the appearance of a message box.

BenAlabaster
  • 39,070
  • 21
  • 110
  • 151
0

not cross browser without creating an custom modal dialong or using one that is already built. if you can use ms ajax then it has a modal you can use.

Quintin Robinson
  • 81,193
  • 14
  • 123
  • 132
0

You can't do it using prompt, you can show a hidden div with html controls and javascript wired up to buttons. When you want to ask the question show the previously hidden div.

0

Try this.

JS code: `if(confirm('Are you sure???')){ {

}else{

}`