Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing title and options in javascript confirm dialog [duplicate]

I want to add my project title to a javascript confirm dialog, and want to change "Ok" and "Cancel" to "Yes" and "No". How can I do this?

like image 927
Mohammad Tausif Razi Avatar asked Jan 27 '26 22:01

Mohammad Tausif Razi


2 Answers

We can't override the functionality of the JS . But you can show your project name on top by using the trick "nextline(/n)" as i did in my project :)

This is just an trail solution for your satisfaction . :)

confirm("ProjectName \n\n\n\n\ some question goes here ");

If you're talking about confirm function in javascript, well, you can't change its properties. I suggest look into using a custom confirm dialog box e.g. jQuery UI's modal confirmation. You have many options out there and by using custom ones you have a lot of things you can do, you can even change colors of the box if you want. Just an idea :)

like image 23
tradyblix Avatar answered Jan 29 '26 11:01

tradyblix



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!