• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 744
  • Last Modified:

Trying to "fancy up" the JavaScript ALERT.

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
jdana
Asked:
jdana
4 Solutions
 
geff_changCommented:
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
 
BadotzCommented:
You can use a DHTML replacement for the alert popup.

http://dhtmlpopups.webarticles.org/
0
 
foobarrCommented:
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
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

 
timhighamCommented:
Using Javascript 'window.open' allows setting a title for and dimensioning a new window.
0
 
cyberhiteshCommented:
you will have to create your own modal window that would act as alert box. Try using modal window provided by jQuery.
0
 
BadotzCommented:
jQuery? Is all that overhead really necessary?
0
 
jdanaAuthor Commented:
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
 
BadotzCommented:
No worries - glad to help.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now