Connecting Tech Pros Worldwide Help | Site Map

CUSTOM ALERT BOX

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 23rd, 2005, 10:11 AM
L-and-F
Guest
 
Posts: n/a
Default 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>



  #2  
Old July 23rd, 2005, 10:11 AM
Randy Webb
Guest
 
Posts: n/a
Default Re: CUSTOM ALERT BOX

L-and-F wrote:[color=blue]
> www.lee-mcgeorge.co.uk
>[/color]

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/
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.