I want to display an error message on my asp.net application. This message is a warning message, this is the way I did it:
CmdCalcInvoke.Attributes["onclick"] = "return confirm('Are you sure you want to calculate the certification? WARNING: If the quarter has not finished, all the partners status will change')";
The code above works fine. The CmdCalcInvoke is an htmlInputButton. This is the message that the message box displays;
Are you sure you want to calculate the certification? WARNING: If the quarter has not finished, all the partners status will change
What I want to do is to display this message, but wanted to highlight the WARNING word by making it bold, or displaying the word in red, can this be done???, can't remember seeing a message box with this characteristics, but I though i would ask in case
Any suggestions will be welcome
you can if you dont use the default alert boxes. Try using a javascript modal window which is just normal div markup that you can control the styling of. Look at blockui for jquery (there are loads of others)
You can try something like: http://weblogs.asp.net/johnkatsiotis/archive/2008/09/14/asp-net-messagebox-server-and-client.aspx
The modal dialog control I use is :
http://foohack.com/tests/vertical-align/dialog.html
http://foohack.com/2007/11/css-modal-dialog-that-works-right/
I find it works well across all browsers. I've hacked it round to work well with ASP .NET, and that was pretty easy.
It isn't possible to apply formatting to a standard dialogue box. However if you really want to format it you could flash up the message in HTML either next to the button or as a absolutely placed div, which you could format with CSS.
Else, use something like a LightBox based solution like Thickbox?
Related
It shows me a simple Alert Box when I use this
<button onclick="alert('AlertBox')">Click Me</button>
But is their any way to have an alert box, with extra bg color and some extra effect look?
use Sweet Alert
Or Make div with fixed position display none, and in javascript when you click on botton change div display to block
Here is the detailed example of Designed Alert Box with help of Sweet Alerts
http://javainfinite.com/html/custom-designed-alerts/
The javascript alert() is a system message box that will will block your page whilst it displays and will look different on different operating systems.
What you are looking for is usually referred to as a dialog box or modal popup, these are constructed using html and javascript to look like the page behind is blocked or greyed out.
If you are starting out, you could look at some examples like:
https://www.w3schools.com/howto/howto_css_modals.asp
These are build from scratch.
Or you could look at using a css librarly like BootStrap which will have these components and other components to help style your website or application.
eg: https://getbootstrap.com/docs/4.3/components/modal/
How do show pop up help messages in jquery?
I.e You might want to let the user know about a new feature, or might want to provide the user with help on how to use a feature.
Your best bet to get started would be the jQuery Dialog which is part of jQuery UI. That can give you basic message abilities
You could use a popup lightbox plugin, there are plenty available, but I'd recommend FancyBox because it's flexible, easy to use, and looks quite professional. You can them to display any content, including simple text, buttons, forms, iframes and images.
Have a div element hidden. Position is absolute, z-index to something greater than 0 (css).
Onclick on some button or something, have javascript change the display of this element to block.
Is it possible to add Bullet points for the warning/Alert message box for a webpage using HTML and Java Script? If not, what would be the best possbile way to create one of those?
The message box should have the below properties:
Warning Image
Message box header
Bullet points listing summary
Accept and Reject button
Thanks in advance!!
Just an update on this, you can create a bullet in a JavaScript alert box, you just need to use \u2022, so your script would be something like this (\n is a line break):
alert("!!! WARNING !!!\n\nHeader\n\u2022Point1\n\u2022Point2")
This will display (in an alert box):
!!! WARNING !!!
Header
Point1
Point2
The standard confirm function cannot do all this; instead, you can use jQuery UI Dialog.
There may be a way to sneak bullet points into an alert() box using some Unicode shenanigans, but in general, these boxes can not be styled. Individually labeled buttons are totally out of the question.
You would have to use a custom-made library like JQUery UI dialogs. Alternatively, here is a more light-weight tutorial on building custom alert boxes.
I believe you need to develop a custom alert box. I may develop it using jQuery colorbox. or jQuery UI Dialogs
I would like to add (with as minimal change to a page as possible) the ability to display a pop-over (i.e. not an actual OS dialog, but part of the page) message box on my homepage that I can call with javascript.
In the worst case I suppose I could resort to the alert() call, but I find these annoying and obtrusive and just want something unobtrusive that will only affect the page.
Something like those pop-over picture boxes you see, but for text, maybe with a headline or something and a close box or 'OK' button.
I tried searching for it, but all I can find are tutorials on using javascript alert().
Update: I just found this question, which has some good links.
I've used this before: http://jquery.malsup.com/block/#demos
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