Skip to main content
rakeshk21205956
Inspiring
July 20, 2016
Answered

I want a javascript for adding minutes (:00 format) and the should be in total (:00000 format)

  • July 20, 2016
  • 1 reply
  • 1404 views

I am making a pdf form in which user has to enter  the time in minutes (:00 format ex - 00:20 means 20 minutes)  and after they have entered all the fields it has to be added up in total field . the form is something like this

  

00:20     this mean 20 minutes

00:10     this means 10 minutes

00:05     this means 5 minutes

00:02     this means 2 minutes

00:50     this means 50 mintes

00:59      this means 59 ,minutes

00:146     the total should be 146 minutes and should in the format :00000  i.e total field should show 00:146 meaning 146 minutes and if total comes 10000 minutes it should as 00:10000

Please if anyone can help me to get this via pdf javascripting.

thanks in advance.

This topic has been closed for replies.
Correct answer try67

wat is javascript for that.. bcoz i a novice in these things.


You can use this code as the custom Format script:

if (event.value!="") event.value = "00:"+event.value;

1 reply

try67
Community Expert
Community Expert
July 20, 2016

What's the point of the "00:" part, then? If you just want to have minutes then you should just enter it as a pure number.

If you use the "00:00" format then the left part should be used for hours and the right part for minutes. So 146 minutes should be entered (or at least displayed) as: "02:26", not as "00:146"...

rakeshk21205956
Inspiring
July 20, 2016

Sir,

But client want to display it as minutes  00:146  (146 minutes)  in the total column not in hours and minutes.

I want that only that one should enter a pure number but it should display in  00:00 format ( if 15 is entered it should show display as 00:15 meaning it is 15 minutes) and then all should add in the total field display  as  00:146.

Plz give me javascript for the above problem.

try67
Community Expert
Community Expert
July 20, 2016

I would just use a custom Format script to add the "00:" part, then.