I have seen many websites that have personalized their alert and confirmation boxes with different button text.
By default, this is what the JavaScript window.confirm()
function would output:
+-----------------------------+
|Message from webpage |
+-----------------------------+
|Popup text |
| |
| |
| |
| |
| [Ok] [Cancel] |
+-----------------------------+
But, what if I wanted some customization like custom header text, and custom button text?
+-----------------------------+
|My custom Header |
+-----------------------------+
|Popup text |
| |
| |
| |
| |
| [HELLO] [GOODBYE] |
+-----------------------------+
Can this be achieved in JavaScript, Jquery, or AJAX (or another language)? If so, could you please show me an example? Thanks!
I wont discover anything new here. And the comments created say all the most relevant information.
You should look at open source alternatives that have great support and are easy to customize. Take a look at BootBoxJS (it depends on jQuery).
In that site you can find examples of alerts, dialogs, and other useful tools. e.g.
To use the mentioned soft:
example.html
or whatever you want to.I just did it and it works perfect! (Under Firefox and Chromium)
NOTE: I tested it with the new version of BootStrap (v.3) and it doesn't work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With