sonu sasankan
sonu sasankan

Reputation: 79

Jquery inputmask time not working

I have been using jquery input mask plugin to mask a input as HH:MM:SS format. but time is not working. Other mask working fine. why?

here is my code

var selector = $("#time");
 $(selector).inputmask("hh:mm:ss", {
  placeholder: "HH:MM:SS", 
  insertMode: false, 
  showMaskOnHover: false,
  alias: "datetime",
  hourFormat: 12
 }
);

I changed hh:mm:ss as 99:99:99 that time it's working but not validating hour and minutes.

Upvotes: 0

Views: 4733

Answers (1)

Bai Nguyen
Bai Nguyen

Reputation: 834

i think you need change $(selector) to selector you can try with this js lib

 <input id="time" name="test1"/>
<script src="https://code.jquery.com/jquery-2.2.4.js"></script>
<script src="https://rawgit.com/RobinHerbots/jquery.inputmask/3.x/dist/jquery.inputmask.bundle.js"></script>
<script>
$("#time").inputmask("hh:mm:ss", {
  placeholder: "HH:MM:SS", 
  insertMode: false, 
  showMaskOnHover: false,
  alias: "datetime",
  hourFormat: 12
 }
);
</script>

Upvotes: 1

Related Questions