View Full Version : Time and date based POP UP.
laserdude
01-10-2008, 03:57 PM
Hi I am trying to make a local site that will give alert the user with POP up in the preset date and time how do i do that..
jscheuer1
01-10-2008, 04:19 PM
<script type="text/javascript">
alert(new Date().toLocaleString());
</script>
laserdude
01-10-2008, 04:22 PM
Thanks for your fast reply please tell me how do i give inputs to this script
jscheuer1
01-10-2008, 04:49 PM
I'm not sure what you mean by 'input'. If you mean an input element, like a button, you don't even need a script block, an onclick event will do:
<input type="button" onclick="alert(new Date().toLocaleString());"
value="Date & Time">
Just put that wherever you want to have a button on your page that will pop up the info.
If you are looking for something else, please be very specific.
laserdude
01-11-2008, 08:14 PM
Sorry I was not able to reply yeserday....
This is what I want..I want make a Local site...I which muliple user can enter a spefic date and time and on the spcefied date and time they must get a POP message as a reminder. and send mail at the time
jscheuer1
01-11-2008, 08:41 PM
By local site, do you mean just on your computer or an intranet, or do you really mean a site out on the web? Do you have a server-side language like asp or PHP available for this? How 'mission critical' is it that these reminders be faithfully kept and executed?
laserdude
01-12-2008, 01:47 AM
Local site i ment to say the site that is viewable only from my office vLAN....I any one of the server admins of a fortune 1000 company....in my 10 hr shift i have make back ups of server data in tapes..our server os is unix...(kind of old) the os does alert us if the tape end is reached....thus resulting in loss of data in back ups..now i have designed the font end in Asp using ms visual web developer...what i want to do is set time based reminders so that I get a POP message for a preset time this would be use by others as well for similar purpose...hope i am clear.
laserdude
01-13-2008, 01:50 AM
hi i have found this scxript but tis only good for single alram how do i make it to set multiple alram
<style type="text/css">
#jsalarmclock{
font-family: Tahoma;
font-weight: bold;
font-size: 12px;
}
#jsalarmclock div{
margin-bottom: 0.8em;
}
#jsalarmclock div.leftcolumn{
float: left;
width: 150px;
font-size: 13px;
background-color: lightyellow;
clear: left;
}
#jsalarmclock span{
margin-right: 5px;
}
</style>
<script type="text/javascript">
var jsalarm={
padfield:function(f){
return (f<10)? "0"+f : f
},
showcurrenttime:function(){
var dateobj=new Date()
var ct=this.padfield(dateobj.getHours())+":"+this.padfield(dateobj.getMinutes())+":"+this.padfield(dateobj.getSeconds())
this.ctref.innerHTML=ct
this.ctref.setAttribute("title", ct)
if (typeof this.hourwake!="undefined"){ //if alarm is set
if (this.ctref.title==(this.hourwake+":"+this.minutewake+":"+this.secondwake)){
clearInterval(jsalarm.timer)
window.location=document.getElementById("musicloc").value
}
}
},
init:function(){
var dateobj=new Date()
this.ctref=document.getElementById("jsalarm_ct")
this.submitref=document.getElementById("submitbutton")
this.submitref.onclick=function(){
jsalarm.setalarm()
this.value="Alarm Set"
this.disabled=true
return false
}
this.resetref=document.getElementById("resetbutton")
this.resetref.onclick=function(){
jsalarm.submitref.disabled=false
jsalarm.hourwake=undefined
jsalarm.hourselect.disabled=false
jsalarm.minuteselect.disabled=false
jsalarm.secondselect.disabled=false
return false
}
var selections=document.getElementsByTagName("select")
this.hourselect=selections[0]
this.minuteselect=selections[1]
this.secondselect=selections[2]
for (var i=0; i<60; i++){
if (i<24) //If still within range of hours field: 0-23
this.hourselect[i]=new Option(this.padfield(i), this.padfield(i), false, dateobj.getHours()==i)
this.minuteselect[i]=new Option(this.padfield(i), this.padfield(i), false, dateobj.getMinutes()==i)
this.secondselect[i]=new Option(this.padfield(i), this.padfield(i), false, dateobj.getSeconds()==i)
}
jsalarm.showcurrenttime()
jsalarm.timer=setInterval(function(){jsalarm.showcurrenttime()}, 1000)
},
setalarm:function(){
this.hourwake=this.hourselect.options[this.hourselect.selectedIndex].value
this.minutewake=this.minuteselect.options[this.minuteselect.selectedIndex].value
this.secondwake=this.secondselect.options[this.secondselect.selectedIndex].value
this.hourselect.disabled=true
this.minuteselect.disabled=true
this.secondselect.disabled=true
}
}
</script>
<form action="" method="">
<div id="jsalarmclock">
<div><div class="leftcolumn">Current Time:</div> <span id="jsalarm_ct" style="letter-spacing: 2px"></span></div>
<div><div class="leftcolumn">Set Alarm:</div> <span><select></select> Hour</span> <span><select></select> Minutes</span> <span><select></select> Seconds</span></div>
<div><div class="leftcolumn">Set Alarm Action:</div> <input type="text" id="musicloc" size="55" value="http://www.youtube.com/watch?v=v1zY_tV5kaQ" /> <span style="font: normal 11px Tahoma">*Location of page to launch</span></div>
<input type="submit" value="Set Alarm!" id="submitbutton" /> <input type="reset" value="reset" id="resetbutton" />
</div>
</form>
<script type="text/javascript">
jsalarm.init()
</script>
laserdude
01-13-2008, 01:51 AM
also is there a way by which i can access stored time from database.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.