Prevent unwanted input in the input field used for timepicker

Hi there,
I am using the datetimepicker (http://xdsoft.net/jqplugins/datetimepicker/) to get a time duration input.
I actually wanted to get a time duration input from the user( ex, 2 min 30 sec... etc).  I decided to use this datetimepicker.
But in the input user should be able to type in valid numbers for secs, minutes and hour only.  Here, I was able to type in anything,.  Is there a way to do this or other input controls that would give me this behaviors.

       var CallDuration = document.createElement("input");
       CallDuration.id = "minCallDurationID";
       CallDuration.type = "text";
 ......

          
        $('#CallDurationID').datetimepicker({
            format : 'HH:mm:ss',
            formatTime : 'HH:mm:ss',
            datepicker : false
        }); 

Open in new window

ambuliAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

David Johnson, CD, MVPOwnerCommented:
if the user types in 2 minutes 90 seconds does it evaluate to 3 minutes 30 seconds?
0
hieloCommented:
try setting a `mask`:
$('#CallDurationID').datetimepicker({
            mask:'23:59:59',
            format : 'HH:mm:ss',
            formatTime : 'HH:mm:ss',
            datepicker : false
        }); 

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ambuliAuthor Commented:
Sorry for not getting back to you on time David.  No, I didn't want user to enter 90.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.