-
-
Save phpleo/774652 to your computer and use it in GitHub Desktop.
Para que MeioMask acepte () espacio y - sin quitarlos del campo de texto
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // http://www.meiocodigo.com/projects/meiomask/ | |
| // alterando la configuracion de meio mask para | |
| // usar () espacio y - en las cajas de texto | |
| $.mask.options = { | |
| attr: 'alt', // an attr to look for the mask name or the mask itself | |
| mask: null, // the mask to be used on the input | |
| type: 'fixed', // the mask of this mask | |
| maxLength: -1, // the maxLength of the mask | |
| defaultValue: '', // the default value for this input | |
| textAlign: true, // to use or not to use textAlign on the input | |
| selectCharsOnFocus: true, //selects characters on focus of the input | |
| setSize: false, // sets the input size based on the length of the mask (work with fixed and reverse masks only) | |
| autoTab: false, // auto focus the next form element | |
| fixedChars : '[,.:/]', // fixed chars to be used on the masks. | |
| onInvalid : function(){}, | |
| onValid : function(){}, | |
| onOverflow : function(){} | |
| }; | |
| $.mask.rules = { | |
| 't': /([\(\)\s\-0-9])/ | |
| }; | |
| $.mask.masks.mskTelefono = {mask: 'tttttt'} | |
| $('#Profesional_TelefonoLugarResidencia').setMask(); | |
| // y el html: | |
| // <input type="text" value="" name="Profesional.TelefonoLugarResidencia" id="Profesional_TelefonoLugarResidencia" alt="mskTelefono" class="valid"> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment