Solved
jQuery Mask Not Working?
Hello! I have a date question with format of mm/dd/yyyy and we would like the slashes '/' to automatically populate. I've been unable to get this to work though. Any suggestions? This is what I've been trying to use to insert placeholder text + trying to apply the mask:
jQuery("#"+this.questionId+" .InputText").attr("placeholder", "mm/dd/yyyy");
jQuery(function (jQuery) {
jQuery("#"+this.questionId).mask("00/00/0000");
});
The placeholder is working fine but the mask does nothing. I've replaced the $ with jQuery by the way.
I might have tunnel vision at this point and am completely missing whatever I'm doing wrong. All of this is going into the addOnReady section by the way.
Best answer by Anonymous
Hello @Pete_L ,
Step 1: Paste the below code in the header ( source view )
<script src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/3/jquery.inputmask.bundle.js" crossorigin="anonymous"></script>
Step 2: Paste the below code in the js(OnReady) of the question
jQuery("#"+this.questionId+" .InputText").inputmask('99/99/9999',{placeholder:"mm/dd/yyyy"});
Also, check content validation on this question
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
