RobinHerbots / Inputmask

Input Mask plugin
https://robinherbots.github.io/Inputmask/
MIT License
6.4k stars 2.17k forks source link

How will I get value when I set outputFormat #2505

Open oscaroxy opened 3 years ago

oscaroxy commented 3 years ago

Hi, I don't understand how get the value with "outputFormat". I define the inputmask like:

$(selector).inputmask("datetime", {
removeMaskOnSubmit: true,
placeholder: 'dd/mm/yyyy',
inputFormat: 'dd/mm/yyyy',
outputFormat:'yyyy-mm-dd',
inputEventOnly: true
});

If I use "$(selector).val()" then I'll obtain the value of text into input, that is if I write "05/05/2021" then I'll obtain $(selector).val()=> 05/05/2021 and not 2021-05-05. How have I to do? thanks

RobinHerbots commented 3 years ago

@oscaroxy ,

The outputformat is the unmaskedvalue. Have a look in the readme.

RobinHerbots commented 3 years ago

Can you add the autounmask option and get the value of the input.

RobinHerbots commented 3 years ago

It's autoUnmask