• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can I change the buttons in a confirm alert box to 'Yes' , 'No'?

 
san krish
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a requirement that requires a confirm box with 'yes' 'No' buttons.
But the default confirm box shows just 'OK', 'Cancel'.
How can i customize them? Im using javascript and Java.
Anyone who has experience in this, please guide me.
sample code would help.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can not change the confirm, alert, or prompt.

You would have to build your own out of html and display it. Look at pre-built stuff like http://jqueryui.com/demos/dialog/#modal-confirmation
 
san krish
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply.
But, I dont want to use JQuery. can I do the same in Javascript?
 
Matthew Brown
Bartender
Posts: 4566
8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jQuery is JavaScript. So anything you can do with that is possible to do in plain JavaScript. It'll just be much harder, as you'll have to do the things that jQuery does for you by yourself.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64716
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
san nav wrote:But, I dont want to use JQuery.

Why not? Do you enjoy re-inventing the wheel? if not jQuery, why not Dojo? Or YUI?

Writing complex script on pages without the aid of one of the useful libraries is not wise. These tools abstract all the complexity and cross-browser nuances away for you.

If you write Java, do you use the Java collection classes? Or have you implemented your own List and Map implementations? Do you write your own JDBC driver?

Availing yourself of the available tools is a good practice.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34207
341
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Adriano Ciz,
Your post was moved to a new topic.
I'm splitting the discussion about libraries into a new thread. It's a good discussion, but isn't about the original topic.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic