Menu DEVPPL Search
160.923
MEMBERS
15.941
TOPICS
63.227
POSTS
  562
FLASH GAMES
7.717
TUTORIALS
 

Login

E-mail:
Password:

how to display the time in a text box

0

Loading

how to display the time in a text box

Postby Neethu » Mon Mar 02, 2009 9:56 am

hi all..
my query goes lik dis..
i ve got a text box in which current time should be displayed after a particular interval of time say for every 10 minutes it should display the current time in that text box..
thanx
Neethu
 
Reputation: 0
Posts: 6
Joined: Mon Mar 02, 2009 9:49 am
Highscores: 0
Arcade winning challenges: 0

how to display the time in a text box - Sponsored results

Sponsored results

Login to get rid of ads

 

0

Loading

Re: how to display the time in a text box

Postby X Bumble » Tue Mar 03, 2009 9:46 am

I would suggest you use either Javascript or PHP to call the time from the server.

Re-post this in one of those forums (if they have them here) and you will get more joy.
X Bumble
 
Reputation: 0
Posts: 8
Joined: Tue Feb 17, 2009 1:31 am
Highscores: 0
Arcade winning challenges: 0
0

Loading

Re: how to display the time in a text box

Postby Neethu » Tue Mar 03, 2009 10:44 am

actually im supposed to use javascript/jsp..
can u pls guide me here!!!
Neethu
 
Reputation: 0
Posts: 6
Joined: Mon Mar 02, 2009 9:49 am
Highscores: 0
Arcade winning challenges: 0
0

Loading

Re: how to display the time in a text box

Postby Rangana » Wed Mar 04, 2009 4:55 am

Code: Select all
<script type="text/javascript">
/**
Script Title: Update Textbox with time with an interval
Script Author: Raymond Angana as first seen on devppl.com/forum [username = rangana]
Date Created: 3/4/09
This notice must stay intact for legal use
*/
var ray = {
   el:'', pause:0,
   
   updateText:function (el,pause) {
      this.el=this.el==''?el:this.el;
      this.pause=this.pause==0?pause:this.pause;
      this.getID(this.el).value = this.timeNow();
      setTimeout(function () {
         ray.updateText();
         },this.pause*(6000));
   },
   
   getID:function (el) {
      return document.getElementById(el);
   },
   
   timeNow:function () {
      var date = new Date();
      var hour = date.getHours();
      var min = date.getMinutes();
      var sec = date.getSeconds();
      return hour+':'+min+' '+sec;
   }
}
</script>
<input type="textbox" id="mytextbox" disabled="disabled">
<script type="text/javascript">
/**
Script Title: Update Textbox with time with an interval
Script Author: Raymond Angana as first seen on devppl.com/forum [username = rangana]
Date Created: 3/4/09
This notice must stay intact for legal use
*/
ray.updateText('mytextbox',10); // Pass the ID of the textbox and the time update interval (computed per minute. 10 means 10 minutes
</script>
Rangana
 
Reputation: 1
Posts: 935
Joined: Wed Feb 27, 2008 6:14 am
Location: Cebu City Philippines
Highscores: 0
Arcade winning challenges: 0
0

Loading

Re: how to display the time in a text box

Postby Neethu » Wed Mar 04, 2009 6:40 am

thanks alot rangana!!!!
it worked..
thanku once agin...
Neethu
 
Reputation: 0
Posts: 6
Joined: Mon Mar 02, 2009 9:49 am
Highscores: 0
Arcade winning challenges: 0
0

Loading

Re: how to display the time in a text box

Postby Neethu » Fri Mar 06, 2009 10:49 am

hi guys..
i ve got data from database to be displayed in one jsp and i should make those datas to be displayed in the next jsp...
how to send those one..
its been urgent... can anyone pls telll me the way??
thanku
Neethu
 
Reputation: 0
Posts: 6
Joined: Mon Mar 02, 2009 9:49 am
Highscores: 0
Arcade winning challenges: 0
^ Back to Top