Menu
  • HOME
  • TAGS

jquery masked input plugin set value digits

javascript,jquery,input,input-mask

A workaround solution might be, $.mask.definitions["9"] = null; $.mask.definitions["^"] = "[0-9]"; $(".id").mask("639-27-^^^-^^^-^^"); remove the definition for 9 add a definition for numeric regex with a new key ex. ^ use the new definition fiddle hope this helps...

Input mask for date plus number

javascript,input-mask,javascriptools

var date = '121215-13456'; // Here is the string you begin with var valid = true; // if valid === true, the string is correct // This will check the structure of the string and store the values in result var result = /^(\d{2})(\d{2})(\d{2})-\d{5}$/.exec(date); // If i didn't match the...

How to restrict Primefaces inputMask to numbers only?

jsf-2,primefaces,input-mask

As shown here : http://www.acnenomor.com/2166977p2/how-to-restrict-an-input-to-numbers-only-with-primefaces-inputmask-element and here: http://forum.primefaces.org/viewtopic.php?f=3&t=37665 I think that approach is right but I noticed that you don't put value attribute on inputMask. Do you try to put it on? Edit: These solutions works: inputMaskTest.xhtml: <h3>Input Mask:</h3> <h:form id="form"> <p:outputLabel value="Input Mask only number " for="userNo1" /> <p:inputMask...

how to restrict only letters and numbers at p:inputMask

jsf,jsf-2,primefaces,input-mask

If your input does not have to be <p:inputMask> and can be <h:inputText> or <p:inputText> then the easiest way to go would be to use it with regex: <h:inputText id="inputField" value="#{backingbean.username}" validatorMessage="Value does not match pattern."> <f:validateRegex pattern="^[a-zA-Z0-9]+$" /> </h:inputText> <h:message for="inputField" /> If you only allow lower case letters...

jquery-inputmask event trigger on not complete

javascript,jquery,input,input-mask,jquery-inputmask

this can be achieved by using this on initialization: $(document).ready(function(){ $("#date").inputmask("d/m/y",{ "onincomplete": function(){ alert('inputmask incomplete'); } }); }); however what i used is actually simpler, which, just clear everything. <input data-inputmask="'alias': 'dd/mm/yyyy', 'clearIncomplete': true"/> ...