Stopwatch javaScript how can I submit it PHP file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Anirhudra
    New Member
    • Dec 2006
    • 4

    Stopwatch javaScript how can I submit it PHP file

    Could you anyone can help me how can I send a Stopwatch Javascript value send it through PHP file ....

    this is my time JavaScript file ...

    var timercount = 0;
    var timestart = 0;

    function displaytime() {
    if(timercount) {
    clearTimeout(ti mercount);
    }
    if(!timestart){
    timestart = new Date();
    }
    var timeend = new Date();
    var timedifference = timeend.getTime () - timestart.getTi me();
    timeend.setTime (timedifference );
    var minutes_passed = timeend.getMinu tes();
    if(minutes_pass ed <10){
    minutes_passed = "0" + minutes_passed;
    }
    var seconds_passed = timeend.getSeco nds();
    if(seconds_pass ed <10){
    seconds_passed = "0" + seconds_passed;
    }
    document.timefo rm.timetextarea .value = minutes_passed + ":" + seconds_passed;
    timercount = setTimeout("dis playtime()", 1000);
    }

    function sw_start(){
    if(!timercount) {
    timestart = new Date();
    document.timefo rm.timetextarea .value = "00:00";
    timercount = setTimeout("dis playtime()", 1000);
    }
    }

    function Stop() {
    if(timercount) {
    clearTimeout(ti mercount);
    timercount = 0;
    }
    }

    function Reset() {
    document.timefo rm.timetextarea .value = "00:00";
    }
    ............

    code you any one send me and example to how can I send this output value ...?????

    It would be very helpful for me if anyone can help me ....
  • b1randon
    Recognized Expert New Member
    • Dec 2006
    • 171

    #2
    Originally posted by Anirhudra
    Could you anyone can help me how can I send a Stopwatch Javascript value send it through PHP file ....

    this is my time JavaScript file ...

    var timercount = 0;
    var timestart = 0;

    function displaytime() {
    if(timercount) {
    clearTimeout(ti mercount);
    }
    if(!timestart){
    timestart = new Date();
    }
    var timeend = new Date();
    var timedifference = timeend.getTime () - timestart.getTi me();
    timeend.setTime (timedifference );
    var minutes_passed = timeend.getMinu tes();
    if(minutes_pass ed <10){
    minutes_passed = "0" + minutes_passed;
    }
    var seconds_passed = timeend.getSeco nds();
    if(seconds_pass ed <10){
    seconds_passed = "0" + seconds_passed;
    }
    document.timefo rm.timetextarea .value = minutes_passed + ":" + seconds_passed;
    timercount = setTimeout("dis playtime()", 1000);
    }

    function sw_start(){
    if(!timercount) {
    timestart = new Date();
    document.timefo rm.timetextarea .value = "00:00";
    timercount = setTimeout("dis playtime()", 1000);
    }
    }

    function Stop() {
    if(timercount) {
    clearTimeout(ti mercount);
    timercount = 0;
    }
    }

    function Reset() {
    document.timefo rm.timetextarea .value = "00:00";
    }
    ............

    code you any one send me and example to how can I send this output value ...?????

    It would be very helpful for me if anyone can help me ....
    Anirhudra, you're already there. All you have to do is make sure that the "name" attribute of "timetextar ea" is set. Then, in the php file you post to, just pull that value form the post data. Your javascript is already set to do that, just be sure the name is there. If you need help with the PHP then move this post to the PHP thread (and I'll reply again there ^^ ).

    Comment

    Working...