PDA

View Full Version : Alert Box!!



tychicus
February 23rd, 2006, 06:55
Hi, where can i find the script for a small alert box? The alert box ( something like ("you got a new message in your inbox") when we enter to a forum. and it will pop up automatically and can be close.Please help me. thanks

webadpro
February 23rd, 2006, 08:07
HEre's 3 way to do it.




<!-- Example of a form button that will open an alert box -->

<form>
<input type="button" value="Open Alert Box"
onClick='alert("Place Your message here... \n Click OK to continue.")'>
</form>

<p>

<!-- Example of a link that will open an alert box -->

<a href='javascript:onClick=alert("Place Your message here... \n Click OK to continue.")'>
Open Alert Box</a>


<!-- Example of a auto load alert box -->
<script language="Javascript">

alert ("Place your message here... \n Click OK to continue.")

</script>

DarkBlood
February 23rd, 2006, 10:01
Place in the head tags:


<script language="JavaScript">

function PMpop(num) {
global num;

if (num == 0) {
// Do nothing.
}
else if (num >== 0) {
alert("You have "+ num +" New Messages.");
}
}
</script>

And then in the source files of your forum YOU WILL need to find the PM part of the board scripting code and edit accordingly. (I'll edit the PHP for you if you want.)

themoose
February 23rd, 2006, 11:22
<body OnLoad="javascript:alert("Click OK to continue blah");">

DarkBlood
February 23rd, 2006, 14:13
But the person only wants it to onLoad if there are messages in the inbox (greater than or equal to 1.)