473,394 Members | 1,722 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

CUSTOM ALERT BOX

www.lee-mcgeorge.co.uk

I've been using custom Alert boxes for a long time in various guises.
The way I've shown below is perhaps the easiest.
There are more efficient and cleaner ways to do it, but this is so easy, it
works a treat.
You can also put new <DIV> tags inside the alert to have "Accept" "Decline"
"Cancel" buttons

www.lee-mcgeorge.co.uk

<html>
<head>

<script>
function stylealert(){
placement.innerHTML=message.newalert.value
}
</script>

</head>
<body>
<form name="message">

<!-- PUT YOUR ALERT AS A FIXED SIZED DIV INSIDE THIS CSS-HIDDEN TEXTAREA -->

<textarea name="newalert" style="visibility:hidden">
<div style="width:256px; height:170px; background-color:yellow; border:solid
1px black;"onClick="this.style.visibility='hidden'">
<br>
<center>
<b>
A new kind of alert box
</b>
<br>
<br>
<br>
Click to Close
</center>
</div>
</textarea>
<input type="button" value="Click for alert" onClick="stylealert()">

</form>

<!-- IF YOU WANT TO POSITION THE ALERT DIV USE CSS - position:absolute;
left:Xpx; top:Xpx -->
<!-- OR USE JAVASCRIPT TO DETERMINE THE CENTER OF THE SCREEN-->
<a name="placement"></a>

</body>
</html>
Jul 23 '05 #1
1 22795
L-and-F wrote:
www.lee-mcgeorge.co.uk


First thing I get are two alert messages telling me that my browser
doesn't meet your warped perception of "acceptable", so I didn't look
further.
Any site that discriminates based on browser usage should be avoided
like the plague.

Read the FAQ, all of it, but especially section 4.26
http://www.jibbering.com/faq/#FAQ4_26
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: netclectic | last post by:
Hi folks, i've searched and searched and can't find any example of what i'm trying to do. Essentially (i think) i need to add a new operator to Number. I'm using eval to evaluate expressions...
3
by: F. Da Costa | last post by:
Hi, I was wondering *why* there is a difference between the results of the following two statements. On the suface they seem to do the same (or do they?) frm => returns void ...
7
by: Phl | last post by:
hi, I can use the following code to set focus to standard html elements but if I try to do the same for a custom element, it seems to complain that it does not support a focus method. Does...
2
by: Zouplaz | last post by:
Hi, I'm trying find a solution to display a contextual helptext when mouse enters a form element (IE6 and Firefox 1.0) The input tag : <input name="message.title" helptext="Help message"...
2
by: Nick | last post by:
I am writing a web application for my company (VB.NET). I am adding a custom web form class to prevent all the code reuse as you can see below... Public Class UIWebForm Inherits...
1
by: rn5a | last post by:
I have created a custom control button which when clicked displays a message in the JavaScript alert dialog. I could successfully compile the VB class file into a DLL & also could add it to the...
6
by: Mr. SweatyFinger | last post by:
hi. i have a bunch of controls that get validated with the validation controls in vs2005 there are two that i could not find a control for so i wrote some javascript. so i set my submit...
2
by: Olorin | last post by:
I'm encountering some weird behavior with the ClientID property. Let's see if I can give you enough info and if anyone has ideas/suggestions. I'm working in ASP.NET 2.0. I have a Web Project with...
2
by: Z1P2 | last post by:
Hello, I'm trying to find a way to replace the user's alert system sound with a custom sound in the following script. Can someone please point me in the right direction? <script...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.