Creating a custom style for Javascript's Confirm Function - javascript

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

Related

Is it possible to give image instead of alert box?

I'm using alert() for javascript and would like to provide an image, i.e. alert(img); - where img is a variable for an image url.
You need to use custom alert box. By default it is not possible.
For example you could look at http://bootboxjs.com which allow to show nice alert with Bootstrap style
The alert box is a system object, and not subject to CSS. To do this style of thing you would need to create an HTML element and mimic the alert() functionality. The jQuery UI Modal box does a lot of the work for you, see here

Regarding Javascript prompt box

i'm currently developing a simple GUI for my mozilla plugin using JSP. In that Gui,i want to create a prompt box with two input fields with drop-down list option. Is it possible with javascript prompt box option?
Not possible with the default window.prompt(); function but you can roll your own overlay or use something like the jQuery UI dialog.
It isn't possible to do this with pure JS prompt boxes, but you can use a library like jQuery UI or Bootstrap.

How to open <ace:dialog> or <p:dialog> by JavaScript?

I need to open ace:dialog or p:dialog (because IceFaces is a fork of PrimeFaces, and it's the same tag and attributes) in area where I've did the click with the mouse, but I don't know how to do this with JavaScript. How can I achieve this?
General: To open the dialog just call onclick="mydialog.show();" on the html element where the click should be possible..
If you want to show the dialog at the "click-position", maybe you should write your own javascript method to set the position..
Or easier, use the property "onShow" of the dialog to set the "position", which is also a property of the dialog.
Have a look here..
http://res.icesoft.org/docs/v3_latest/ace/tld/ace/dialog.html

Custom Confirm Form by jQuery

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.

How to apply style to a confirm pop-up window

is it possible to give style to a confirm dialog box in javascript?
i am using asp.net with c#.
Eg:-
OnClientClick='javascript:return confirm("Are you sure, Do you really want to delete this item ")'
how to give style for this dialog box?
The regular alert and confirm boxes are based on the window style currently applied to the operating system.
There are replacements available though for the alert and confirm boxes. There are more than this one if you search for it.
If you can use jQuery then take a look at
jQuery Alert Dialogs (Alert, Confirm, & Prompt Replacements)
and
Confirm Override

Categories