Masked input
Posted: 2016-05-20 23:29
It would be nice to have support for masked input.
For example:
http://digitalbush.com/projects/masked-input-plugin
For example:
http://digitalbush.com/projects/masked-input-plugin
A place where AppGini users can exchange ideas and help each other.
https://forums.appgini.com:443/phpbb/
https://forums.appgini.com:443/phpbb/viewtopic.php?f=6&t=2086
Code: Select all
<script src="hooks/jquery.maskedinput.js" type="text/javascript"></script>
Code: Select all
$j(function(){
$j('#phone').mask('(999) 999-9999');
$j('#cell').mask('(999) 999-9999');
$j('#fax').mask('(999) 999-9999');
});
Cool, it allows the calendar too?grimblefritz wrote:I have masked input working. And it's pretty simple.
Copy the js script from http://digitalbush.com/projects/masked-input-plugin/
Put the js file in your hooks folder.
Insert this code at the bottom of hooks/footer-extras:
In your hooks/tablename-dv.js, do this:Code: Select all
<script src="hooks/jquery.maskedinput.js" type="text/javascript"></script>
Of course, there are different masks and you'll use your own field names.Code: Select all
$j(function(){ $j('#phone').mask('(999) 999-9999'); $j('#cell').mask('(999) 999-9999'); $j('#fax').mask('(999) 999-9999'); });
The maskedinput plugin is not perfect (it doesn't validate date or time entries, etc), but for phone numbers, government ID numbers, credit card numbers, etc, it does pretty good.
Link appears to be dead???grimblefritz wrote: ↑2016-05-20 23:29It would be nice to have support for masked input.
For example:
http://digitalbush.com/projects/masked-input-plugin
Has anyone been able to get this to work?? and if so, is there possibly an example project?grimblefritz wrote: ↑2016-08-30 23:11Next free bit of time I have, I might experiment with this one:
https://github.com/RobinHerbots/jquery.inputmask
It's more complicated, but it allows data validation. Not only can specify a mask that looks like 99/99/9999 for a date, but you can include validation code to ensure the date is legit and in range.
And other goodies.
Code: Select all
<script src="hooks/jquery.inputmask.js"></script>
Code: Select all
$j('#Phone').inputmask({"mask": "(999) 999-9999"});