Skip to content

Instantly share code, notes, and snippets.

@shane-reaume
Created November 1, 2012 21:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shane-reaume/3996680 to your computer and use it in GitHub Desktop.
Save shane-reaume/3996680 to your computer and use it in GitHub Desktop.
Phone mask for phone field, taken off for mobile devices
jQuery(function ($e) {
"use strict";
var isMobile = navigator.userAgent.match(/(iPhone|iPod|iPad|Android|BlackBerry)/);
if (!(isMobile)) {
$e('#refer').val(window.location.href);
$e.mask.definitions['~'] = '[+-]';
$e('#phone').mask('(999)999-9999');
$e('#field_phone_number').mask('999-999-9999');
}
});
@shane-reaume
Copy link
Author

Must use jQuery maskedinput-1.3.js and jQuery. Would be nice to build something for mobile

@shane-reaume
Copy link
Author

*to uppercase in css for name
.rsform-input-box {text-transform: uppercase;}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment