Created
November 1, 2012 21:24
-
-
Save shane-reaume/3996680 to your computer and use it in GitHub Desktop.
Phone mask for phone field, taken off for mobile devices
This file contains 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
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'); | |
} | |
}); |
*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
Must use jQuery maskedinput-1.3.js and jQuery. Would be nice to build something for mobile