Shopping cart    |      
Results 1 to 5 of 5

Thread: Want to add an auto-increment of number of attempts to your web-app? here's how:

  1. #1
    Join Date
    Mar 2007
    Posts
    55

    Lightbulb Want to add an auto-increment of number of attempts to your web-app? here's how:

    I just spent a little time poking around in javascript, trying to figure out how to automatically increment the number of attempts field when you get the time for the time of last attempt button... here's what you need to do:

    inside the function SetAttTimeDate() (this is the function called when you press the "get date" button by the time of last attempt) add the following line of code:
    document.TLForm.elements.TL_ATTEMPTS_EDIT.value = parseInt(document.TLForm.elements.TL_ATTEMPTS_EDIT .value) + 1;


    Alternately, you could add a new button and function to incriment the number of attempts, but the less button pushes in my opinion the better.

    I'm always looking for ways to speed up the testing process, and make things as simple as possible... If anyone else has any helpful javascript functions for testlog, let us know!

  2. #2
    Join Date
    Mar 2005
    Posts
    912

    Default

    Stickied

  3. #3
    Join Date
    Mar 2007
    Posts
    55

    Default

    I've modified my javascript to only increment one time per edit (so you can keep hitting the get date button and it will only add one attempt for each time you enter the edit page). Here's how:

    outside the scope of any function (at the very top of the <script> section of the template file) create a new global variable:
    var attempted = 0;

    in the function SetAttTimeDate(), replace:
    document.TLForm.elements.TL_ATTEMPTS_EDIT.value = parseInt(document.TLForm.elements.TL_ATTEMPTS_EDIT .value) + 1;

    with:
    if (attempted == 0)
    {
    document.TLForm.elements.TL_ATTEMPTS_EDIT.value = parseInt(document.TLForm.elements.TL_ATTEMPTS_EDIT .value) + 1;
    attempted = 1;
    }

  4. #4
    Join Date
    Dec 2010
    Posts
    6

    Default Only for web-app

    Hi,

    Is the Java script applicable only on the web-app version or there is a way to somehow implement it on the regular version?

    Thanks,
    Regards,

    WD

  5. #5
    Join Date
    Mar 2005
    Posts
    912

    Default

    This is only applicable to the web version of TestLog.

Posting Permissions

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