Custom Confirm Form by jQuery - javascript

Now I use return confirm(Message); when need confirmation in a form. that cause displaye a form with two button OK and Cancel. Is there any way to change the buttons text in displayed form? I need to change buttons to another language? what is your suggestion?

Since you tagged jquery, jQuery UI Modal Confirm is definitely worth a look
Working fiddle: http://jsfiddle.net/naveen/GR2UT/

You can't change the button text on a native confirm box. You can program your own modal dialog, which would give you control to what's in the buttons. In this jsfiddle you'll find a plain javascript example. Or use JQuery, like naveen suggested.

Related

alert box without ok button in jQuery

How to show alert box without "OK" button and close after 2 seconds
setTimeout(function() {
alert("$premium$");
}, 1);
It's not possible to amend the dialog shown by the standard alert() method as the buttons are controlled by the browser/OS.
If you need this behaviour you'll need to use a library which builds alert notifications in HTML which can be amended exactly as you require.
You should create your own alertbox I think in vanilla CSS
You cannot hide buttons from native JavaScript dialogs. Your options depends on frameworks you are using. You can create custom dialogs with jQuery UI, Bootstrap and many other frameworks.

Confirmbox with custom button text

when we use confirm prompt box , it always display "ok" and "cancel" buttons
I want to change the label text for the ok and cancel buttons as Agree and Not Agree
please do suggest any solution
What i can suggest you is apply or override CSS; which i think is not at all a better solution.
Next you can go with following link posted below.
JavaScript confirm box with custom buttons.
Hope this helps.

Creating a custom style for Javascript's Confirm Function

Is it possible to custom style the javascript's "Confirm Function" dialog box, instead of using the the default look and feel that is provided by the browser? If not is there an alternative solution to this?
if you want to custom look for confirm box , you need to use jalert javascript for that.
check link below hope it will help you.
http://labs.abeautifulsite.net/archived/jquery-alerts/demo/
you can not style javascript "confirm function" dialog box because its default option if you want to do the same then you have to create your own dialog box with the help of Javascript/jQuery and CSS
E.g. http://demos.9lessons.info/alert_delete.html

JQuery / Javascript popup box and form submission creation

I have a jquery/javascript question. For a site I am working on in PHP/JQuery I have the need to create a dialogue box with an ok/cancel button and a message and then submit a form based on if the user says ok or not. I know in javascript I can create a new window that links to a styled page and then I can do a select for if the user hits the ok button and submit the windows parent form using that but the last time I coded something similar to it I felt like it took a lot of lines of code and was wondering if JQuery supported dialogue box creation and if I could do some similar functionality using it (with hopefully less lines of code since everytime I use jquery instead of standard javascript it seems like it really reduces my codebase). If anyone knows of a resource to learn how to do this I would appreciate a link or a second of your time for some pointers.
Thanks!
I think you are looking for something along the lines of the jquery ui dialog.

Looking for particular alert box behavior

I'm interested in alert boxes such as,
http://www.visual-blast.com/javascript/nice-alert-box-with-jquery-impromptu/
and
http://woork.blogspot.com/2008/08/design-stunning-alert-box-using.html
but with a different functionality, the user should be able to interact with the page even with the alert box present, so it needs to be movable and not obscure the underlying page, as in this example,
http://www.open-lab.com/mb.ideas/index.html
Alert box should be generated automatically on page view plus the title and message of the alert box should change with each page refresh from expandable library.
Is there anything out there like this?
Thanks
Sounds like the jQuery UI dialog widget might do what you need?
http://jqueryui.com/demos/dialog/
Here is an example with mootools. You easily can extend any element on the page to be draggable. You may use this plugin as a sample of alerts and you'll just need to remove some functionality and add make it draggable.
There are few custom dialogs in moo.rd. One of them is the Custom.Alert:
http://www.moord.it/examples/custom_alert

Categories