Textbox calculation

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nussu
    New Member
    • Nov 2007
    • 23

    Textbox calculation

    Hi ,

    i have 4 textbox's vertically , in that in first 3 textbox's i am entering values in time formati.e in HH:MM:SS .There is no am/pm after time format.

    for ex : a textbox has to accept only time format as 23:00:00 .

    Now in textbox4 i need to calculate average of the above 3 textbox's i.e average of 3 textbox's time format whihc is in HH:MM:SS format.

    once i comeout of 3rd textbox the average of above 3 textbox's has 2 display in 4th textbox.

    Plz provide me code or javascript..... ..

    Plz help me ........

    Rgds,

    Nusrath.
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Use the split method to split the string value from the textbox using ":" as the delimiter.

    Use the resulting array to calculate the average.

    Comment

    • nussu
      New Member
      • Nov 2007
      • 23

      #3
      Textbox calculation !!!

      Hi ,

      i have 4 textbox's vertically , in that in first 3 textbox's i am entering values in time formati.e in HH:MM:SS .There is no am/pm after time format.

      for ex : a textbox has to accept only time format as 23:00:00 .

      Now in textbox4 i need to calculate average of the above 3 textbox's i.e average of 3 textbox's time format whihc is in HH:MM:SS format.

      once i comeout of 3rd textbox the average of above 3 textbox's has 2 display in 4th textbox.

      In 4th textbox the average also has to fisplay in time format only i.e in HH:MM:SS.

      Plz provide me code or javascript..... ..

      Plz help me ........




      Rgds,

      Nussu.

      Comment

      • Markus
        Recognized Expert Expert
        • Jun 2007
        • 6092

        #4
        You've asked this 3times in as less days.

        The reason your question isn't getting answered is because it is clear you lack any knowlege in coding with javascript.

        We, at tsDN, are not here to provide you with complete code; we are here to assist you and give you a push(in your case a kick) in the right direction.

        Please go read some tutorials, many can be found on the big interwebs, and try it yourself.

        mark.

        Comment

        • acoder
          Recognized Expert MVP
          • Nov 2006
          • 16032

          #5
          Threads merged. Please do not double/triple post especially after receiving a response.

          Comment

          • nussu
            New Member
            • Nov 2007
            • 23

            #6
            Time format Calculation .........

            Hi ,

            I need a javascript..... .. or........... code.

            i have 4 textbox's vertically , in that in first 3 textbox's i am entering values in time formati.e in HH:MM:SS .There is no am/pm after time format.

            for ex : a textbox has to accept only time format as 23:00:00 .

            Now in textbox4 i need to calculate average of the above 3 textbox's i.e average of 3 textbox's time format whihc is in HH:MM:SS format.

            once i comeout of 3rd textbox the average of above 3 textbox's has 2 display in 4th textbox.

            In 4th textbox the average also has to display in time format only i.e in HH:MM:SS.

            Plz provide me code or javascript..... ..

            Plz help me ........




            Rgds,

            Nusrath.

            Comment

            • gits
              Recognized Expert Moderator Expert
              • May 2007
              • 5388

              #7
              threads merged again ... DON'T multipost your question on the same topic ... to bump up your question you may reply to your own post ... and wait for answers ... did you made an attempt for yourself already? please post the code you have so far ... or ask a specific question regarding the response that you already have with the split-method ...

              regards
              gits

              Comment

              • nussu
                New Member
                • Nov 2007
                • 23

                #8
                Ya i am new to .net and javascript.....
                I m fresher.......

                Comment

                • acoder
                  Recognized Expert MVP
                  • Nov 2006
                  • 16032

                  #9
                  You've got to make an attempt yourself first and we'll help you with any problems that you might have with your code.

                  Show us what code you have so far.

                  Also, see post #2 in this thread for some ideas on how to go about solving the problem.

                  Comment

                  • nussu
                    New Member
                    • Nov 2007
                    • 23

                    #10
                    Javascript

                    Hi,

                    I have time format in HH:MM:SS in a textbox , I need to get first two digits from this time format .

                    Plz help using javascript.

                    Regards,

                    Nussu

                    Comment

                    • acoder
                      Recognized Expert MVP
                      • Nov 2006
                      • 16032

                      #11
                      Assuming the time is validated and in the right format:
                      [CODE=javascript]var time = textbox.value.s plit(":");
                      hour = time[0];[/CODE]

                      PS: threads merged.

                      Comment

                      Working...