Results 1 to 9 of 9

Thread: Time and date based POP UP.

  1. #1
    Join Date
    Apr 2007
    Posts
    23
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Time and date based POP UP.

    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..

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,076
    Thanks
    44
    Thanked 3,216 Times in 3,178 Posts
    Blog Entries
    12

    Default

    Code:
    <script type="text/javascript">
    alert(new Date().toLocaleString());
    </script>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Apr 2007
    Posts
    23
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Thanks for your fast reply please tell me how do i give inputs to this script

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,076
    Thanks
    44
    Thanked 3,216 Times in 3,178 Posts
    Blog Entries
    12

    Default

    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:

    HTML Code:
    <input type="button" onclick="alert(new Date().toLocaleString());" 
    value="Date &amp; 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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Apr 2007
    Posts
    23
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    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

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,076
    Thanks
    44
    Thanked 3,216 Times in 3,178 Posts
    Blog Entries
    12

    Default

    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?
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #7
    Join Date
    Apr 2007
    Posts
    23
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    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.

  8. #8
    Join Date
    Apr 2007
    Posts
    23
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    hi i have found this scxript but tis only good for single alram how do i make it to set multiple alram
    Code:
    <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>

  9. #9
    Join Date
    Apr 2007
    Posts
    23
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    also is there a way by which i can access stored time from database.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •