0

To implement form masking I followed this example:

http://html.codedthemes.com/gradient-able/default/form-masking.html

Instead of this:

<input type="text" class="form-control date" data-mask="99/99/9999">

I want to do this:

<input type="text" class="form-control date" data-mask="99.99.9999">

These scripts are involved:

<script src="../files/assets/pages/form-masking/inputmask.js"></script> 
<script src="../files/assets/pages/form-masking/jquery.inputmask.js"></script> 
<script src="../files/assets/pages/form-masking/autoNumeric.js"></script> 
<script src="../files/assets/pages/form-masking/form-mask.js"></script> 

I changed form-mask.js to start like this:

'use strict';$(function(){$(".date").inputmask({mask:"99.99.9999"});

But that didnt do it.

1 Answer 1

1

You can try this.

You have the part correct that gets all the fields with date in it.

Then, you have to change the data-mask attribute. Since its a generic field, we use the jquery function attr for that.

$(".date").attr('data-mask','99.99.9999');

http://api.jquery.com/attr/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.