I have a date of birth text field:
I\'m using a jQuery plug
Reading the plugin code, it should be possible to do this (untested):
(function($) {
$(document).ready(function() {
$('#dob').focus(function() {
$.mask.definitions['~']='[+-]';
$(this).mask('99/99/9999');
}).blur(function() {
$(this).unmask();
});
});
})(jQuery);
Note that I added (function($){})(jQuery) - I believe it is good practice to wrap all your code this way.