15,897,334 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by ambujmalviya (Top 17 by date)
ambujmalviya
13-Oct-12 7:09am
View
my value are properly inserted in first database where the page is located but i did not understand how it can be inserted on other database that is situated on different server.
ambujmalviya
13-Oct-12 3:05am
View
i want to connect both the databases and insert value in both database from a single php page
ambujmalviya
21-Sep-12 5:09am
View
i can do same as for one database but problem is that on my page where i already fetch value from four different table. and when i want to add this database then my some table are not working properly.so i facing problem in display.
ambujmalviya
21-Sep-12 5:09am
View
i can do same as for one database but problem is that on my page where i already fetch value from four different table. and when i want to add this database then my some table are not working properly.so i facing problem in display.
ambujmalviya
24-Aug-12 5:52am
View
i am getting data on first row but it show error from the next row.why it happens..?
ambujmalviya
14-Aug-12 6:48am
View
and second thing my mails are still going but they not show any value from database like first name etc how can i do it.?
ambujmalviya
14-Aug-12 6:37am
View
my mail function working fine earlier but when i inserted a table in them it crate a problem,and i also tried with mysql_fetch_assoc but it not gives any result
ambujmalviya
24-Jul-12 13:17pm
View
thanks for help but it is not working. i tried earlier this.disabled='disabled' but it is not working on my page,and second example that you given it working only untill we dont refresh the page when we refresh the page then it will clickable.
ambujmalviya
24-Jul-12 12:25pm
View
thanks for suggestion but it is not the solution of my problem.
ambujmalviya
16-Jun-12 5:17am
View
i am using these stop watch in a dynamic page where they are decrease or increase on the basis of pending issue there are not a fixed stop watch in the page when the case close then total entry automatically deleted.
ambujmalviya
16-Jun-12 4:59am
View
the code is here
<script language="javascript" type="text/javascript">
<!--
var swCycleTime=50; //run cycle every 50ms?
// Functional Code
var sw,swObj,swct,swnow,swcycle; //create some variables, we'll figure out what they are soon
var swObjAry=new Array(); //and i assume that for every stopwatch on the page an object is created and this is the container array
function swStart(id,ud){ //ok so you click the button which would onclick="swstart($divname,+);" the plus is for count upwards, you can - it
swObj=document.getElementById(id); //so the swobj var is your actual div by the look of it
swct=swObj.innerHTML.split(':'); //and it splits the time into minutes, seconds, milliseconds into an array
swnow=new Date(); //this is the time the button got clicked
swObj.now=swnow.getTime(); //and it fires that variable into swobj's now value
swObj.reset=swObj.innerHTML; //it takes a note of whats in the div so that when you reset, it puts the initial value back in
swObj.ud=ud; //the stopwatch object is told wether to count up or down
if (!isNaN(swObj.innerHTML)){ //if the initial value turns out to be a string,
swObj.time=parseInt(swObj.innerHTML); //parse it to an int
}
else if (swct.length==4){ //otherwise if our split is 4 long, for hours!
swObj.time=(swct[0]*1000*60)+(swct[1]*1000*60)+(swct[2]*1000)+parseInt(swct[3]); //the stopwatches time so far is mins + secs +ms (total being in ms)
}
else if (swct.length==3){ //otherwise if our split is 3 long
swObj.time=(swct[0]*1000*60)+(swct[1]*1000)+parseInt(swct[2]); //the stopwatches time so far is mins + secs +ms (total being in ms)
}
else if (swct.length==2){ //or if its just seconds and milliseconds
swObj.time=(swct[0]*1000)+parseInt(swct[1]);
}
else if (swct.length==1){ //or just milliseconds
swObj.time=parseInt(swct[1]);
}
if (!swObj.time){ //if it has only just started at 0
swObj.time=1; //give it a millisecond to get it started
}
if (!swObj.c){ //if there isnt a c value (whatever c is :-P )
swObj.c=ud; //then make it + or -, whatever ud was
swObjAry[swObjAry.length]=swObj; //i dont get this - make the number of stopwatches = swobj, the div? :-s
}
}
function swStop(id){ //anyway, so if you click the stop button (onclick="swstop($divname)"),
swObj=document.getElementById(id); //get the stopwatch div name
if (!swObj.time){ return; } //if there is no time variable, its already stopped. coolio.
swObj.time=null; //get rid of the time value
sw=new Date().getTime(); //this next bit will have to do with when you resume i suppose
swObj.cycle+=(sw-swcycle);
if (swObj.ud=='-'){
swObj.cycle-=(sw-swcycle);
if (swObj.cycle<0){ swObj.cycle=0; }
}
swObj.innerHTML=(parseInt(swObj.cycle/1000/60/60)%60)+':'+(parseInt(swObj.cycle/1000/60)%60)+':'+((parseInt((swObj.cycle)/1000)%60)+':'+(swObj.cycle%1000));
//display the time you stopped on, i added an extra bit here hor the hour
}
function swCycle(){ //and this will be the running cylce then
swcycle=new Date().getTime();
for (sw0=0;sw0<swobjary.length;sw0++){
if (swobjary[sw0].time){
swobjary[sw0].cycle="swObjAry[sw0].time+(swcycle-swObjAry[sw0].now);
if" (swobjary[sw0].ud="='-'){
swObjAry[sw0].cycle=swObjAry[sw0].time-(swcycle-swObjAry[sw0].now);
if" (swobjary[sw0].cycle<0){="" swobjary[sw0].cycle="0;" swobjary[sw0].time="0;" }
}
swobjary[sw0].innerhtml="(parseInt(swObjAry[sw0].cycle/1000/60/60)%60)+':'+(parseInt(swObjAry[sw0].cycle/1000/60)%60)+':'+((parseInt((swObjAry[sw0].cycle)/1000)%60)+':'+(swObjAry[sw0].cycle%1000));" added="" an="" hour="" bit="" here="" too
}
}
}
function="" swreset(id,dt){
swobj="document.getElementById(id);
swObj.innerHTML=swObj.reset;
swObj.time=null;
}
setInterval('swCycle()',swCycleTime);
//
</script">
<input type="button" value="Start" önclick="swStart('beg2','+');">
<input type="button" value="Stop" önclick="swStop('beg2');">
<input type="button" value="Reset" önclick="swReset('beg2');">
<div id="beg2">0:00:00:000</div>
ambujmalviya
16-Jun-12 4:57am
View
Deleted
here is the code
<script language="javascript" type="text/javascript">
<!--
var swCycleTime=50; //run cycle every 50ms?
// Functional Code
var sw,swObj,swct,swnow,swcycle; //create some variables, we'll figure out what they are soon
var swObjAry=new Array(); //and i assume that for every stopwatch on the page an object is created and this is the container array
function swStart(id,ud){ //ok so you click the button which would onclick="swstart($divname,+);" the plus is for count upwards, you can - it
swObj=document.getElementById(id); //so the swobj var is your actual div by the look of it
swct=swObj.innerHTML.split(':'); //and it splits the time into minutes, seconds, milliseconds into an array
swnow=new Date(); //this is the time the button got clicked
swObj.now=swnow.getTime(); //and it fires that variable into swobj's now value
swObj.reset=swObj.innerHTML; //it takes a note of whats in the div so that when you reset, it puts the initial value back in
swObj.ud=ud; //the stopwatch object is told wether to count up or down
if (!isNaN(swObj.innerHTML)){ //if the initial value turns out to be a string,
swObj.time=parseInt(swObj.innerHTML); //parse it to an int
}
else if (swct.length==4){ //otherwise if our split is 4 long, for hours!
swObj.time=(swct[0]*1000*60)+(swct[1]*1000*60)+(swct[2]*1000)+parseInt(swct[3]); //the stopwatches time so far is mins + secs +ms (total being in ms)
}
else if (swct.length==3){ //otherwise if our split is 3 long
swObj.time=(swct[0]*1000*60)+(swct[1]*1000)+parseInt(swct[2]); //the stopwatches time so far is mins + secs +ms (total being in ms)
}
else if (swct.length==2){ //or if its just seconds and milliseconds
swObj.time=(swct[0]*1000)+parseInt(swct[1]);
}
else if (swct.length==1){ //or just milliseconds
swObj.time=parseInt(swct[1]);
}
if (!swObj.time){ //if it has only just started at 0
swObj.time=1; //give it a millisecond to get it started
}
if (!swObj.c){ //if there isnt a c value (whatever c is :-P )
swObj.c=ud; //then make it + or -, whatever ud was
swObjAry[swObjAry.length]=swObj; //i dont get this - make the number of stopwatches = swobj, the div? :-s
}
}
function swStop(id){ //anyway, so if you click the stop button (onclick="swstop($divname)"),
swObj=document.getElementById(id); //get the stopwatch div name
if (!swObj.time){ return; } //if there is no time variable, its already stopped. coolio.
swObj.time=null; //get rid of the time value
sw=new Date().getTime(); //this next bit will have to do with when you resume i suppose
swObj.cycle+=(sw-swcycle);
if (swObj.ud=='-'){
swObj.cycle-=(sw-swcycle);
if (swObj.cycle<0){ swObj.cycle=0; }
}
swObj.innerHTML=(parseInt(swObj.cycle/1000/60/60)%60)+':'+(parseInt(swObj.cycle/1000/60)%60)+':'+((parseInt((swObj.cycle)/1000)%60)+':'+(swObj.cycle%1000));
//display the time you stopped on, i added an extra bit here hor the hour
}
function swCycle(){ //and this will be the running cylce then
swcycle=new Date().getTime();
for (sw0=0;sw0<swobjary.length;sw0++){
if (swobjary[sw0].time){
swobjary[sw0].cycle="swObjAry[sw0].time+(swcycle-swObjAry[sw0].now);
if" (swobjary[sw0].ud="='-'){
swObjAry[sw0].cycle=swObjAry[sw0].time-(swcycle-swObjAry[sw0].now);
if" (swobjary[sw0].cycle<0){="" swobjary[sw0].cycle="0;" swobjary[sw0].time="0;" }
}
swobjary[sw0].innerhtml="(parseInt(swObjAry[sw0].cycle/1000/60/60)%60)+':'+(parseInt(swObjAry[sw0].cycle/1000/60)%60)+':'+((parseInt((swObjAry[sw0].cycle)/1000)%60)+':'+(swObjAry[sw0].cycle%1000));" added="" an="" hour="" bit="" here="" too
}
}
}
function="" swreset(id,dt){
swobj="document.getElementById(id);
swObj.innerHTML=swObj.reset;
swObj.time=null;
}
setInterval('swCycle()',swCycleTime);
//
</script">
<input type="button" value="Start" önclick="swStart('beg2','+');">
<input type="button" value="Stop" önclick="swStop('beg2');">
<input type="button" value="Reset" önclick="swReset('beg2');">
<div id="beg2">0:00:00:000</div>
ambujmalviya
16-Jun-12 4:29am
View
in my site there are work assign for completion to technician where i want to know about how much time taken by the technician in solving the problem.i implement a simple stop watch with the help of java script and is working untill when we stay on page but when we go another page then it is stopped.
and next problem is that when i try it to multiple stopwatch implement in the same page then only one is working.
sorry for gramitical error becoz my english is week.
ambujmalviya
16-Jun-12 2:50am
View
it display with the help of javascript
ambujmalviya
16-Jun-12 2:49am
View
one watch will be displayed and working properly but when i try it to multiple watches then it stops work
ambujmalviya
15-Jun-12 7:45am
View
thanks for your help but i am still unable to do this.
ambujmalviya
15-Jun-12 7:38am
View
i tried use this javascript stopwatch. but it pause when i move the other page of the site and it automatically start when i come on the page again.what is the reason..?
Show More