Solved

Trying to "fancy up" the JavaScript ALERT.

Posted on 2011-03-06
8
734 Views
Last Modified: 2012-05-11
Take a look at the attached image.  This shows the result of some JavaScript validation that I built into a web form.  The JavaScript gets the job done.  The user sees the message they need to.  I sure would like to make the alert look a little nicer, however.  

- Is there a way to add a custom title to the alert as opposed to "The page at http://parkassets.boulder.local says..."?
- Is it possible to add icons to alerts?  (Like a yield sign with an exclamation point, or a big red "X")?

It might be worth noting that the image shown below comes from an ASP.NET call that prompts a JavaScript call.
SimpleAlert.jpg
0
Comment
Question by:jdana
8 Comments
 
LVL 1

Accepted Solution

by:
geff_chang earned 63 total points
ID: 35046070
Unfortunately, you can't change the title.

For fancy dialogs, you can try using 3rd-party jQuery dialogs.
Check this out: http://jqueryui.com/demos/dialog/
0
 
LVL 29

Assisted Solution

by:Badotz
Badotz earned 63 total points
ID: 35046443
You can use a DHTML replacement for the alert popup.

http://dhtmlpopups.webarticles.org/
0
 
LVL 7

Assisted Solution

by:foobarr
foobarr earned 62 total points
ID: 35061847
You could create your own aspx page and instead of using alert("Your Message") you could call that page with specific parameters and just have the page popup as a modal dialog window
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 3

Assisted Solution

by:timhigham
timhigham earned 62 total points
ID: 35063340
Using Javascript 'window.open' allows setting a title for and dimensioning a new window.
0
 
LVL 2

Expert Comment

by:cyberhitesh
ID: 35085630
you will have to create your own modal window that would act as alert box. Try using modal window provided by jQuery.
0
 
LVL 29

Expert Comment

by:Badotz
ID: 35086013
jQuery? Is all that overhead really necessary?
0
 

Author Closing Comment

by:jdana
ID: 35095245
geff,

I like the jQuery suggestion.  Since the page already calls about 200 lines of jQuery code, I figure a few more aint gonna hurt.

Badotz,

The DHTML suggestion is interesting.

foobar,

If I wasn't already using jQuery, I'd take your approach.

timhigham,

window.open sounds like really economic solution.  

Thanks to all!
0
 
LVL 29

Expert Comment

by:Badotz
ID: 35095340
No worries - glad to help.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question