how to display the time in a text box

TOPIC CREATED: 2009-03-02

First Post Yakko
Posted: 2009-03-02 08:56:53

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


5 Replies

Reply #1 X-Bumble
Posted: 2009-03-03 08:46:25

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.


Reply #2 Yakko
Posted: 2009-03-03 09:44:18

actually im supposed to use javascript/jsp..
can u pls guide me here!!!


Reply #3 rangana
Posted: 2009-03-04 03:55:40


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



Reply #4 Yakko
Posted: 2009-03-04 05:40:10

thanks alot rangana!!!!
it worked..
thanku once agin...


Reply #5 Yakko
Posted: 2009-03-06 09:49:22

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





JOIN DEVPPL

It looks like you are new here. If you want to get involved, click on Join below!




MENU
Advertising