Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove underline from jQuery input mask plugin textboxes

I want to remove underline from masked input implemented using jQuery inputmask plugin- http://github.com/RobinHerbots/jquery.inputmask enter image description here

like image 806
nickalchemist Avatar asked Sep 21 '15 05:09

nickalchemist


3 Answers

To remove the mask, use the placeholder option. Assigning an empty string to placeholder, removes the mask. You can assign the placeholder when creating the mask:

$('input').inputmask("mask name", {"placeholder": ""});

Or change it afterwards:

$('input').inputmask({"placeholder": ""});
like image 74
Ori Drori Avatar answered Oct 18 '22 05:10

Ori Drori


You can specify the placeholder (by default _) like this:

$(document).ready(function(){
   $("#date").inputmask("d/m/y",{ "placeholder": "dd/mm/yyyy" });
});

The placeholder can also be a single character, in that case it is repeated for the whole length of your input.

$(document).ready(function(){
   $("#code").inputmask("aaaa",{ "placeholder": "*" });
});

So to remove it you specify an empty placeholder like:

$(document).ready(function(){
   $("#noplaceholder").inputmask("aaaa",{ "placeholder": "" });
});
like image 43
Bas van Stein Avatar answered Oct 18 '22 04:10

Bas van Stein


You can also use data-placeholder="" and initialize just like that. Regards

P.D: I'm using Jasny : http://www.jasny.net/bootstrap/javascript/#inputmask-examples

like image 31
Horacio Escoto Avatar answered Oct 18 '22 05:10

Horacio Escoto