Solved

Trying to "fancy up" the JavaScript ALERT.

Posted on 2011-03-06
8
732 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
 
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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
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…

706 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now