RobinHerbots / Inputmask

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

removeMaskOnSubmit doesn't work or I'm doing it wrong #1774

Open ElFitaFlores opened 6 years ago

ElFitaFlores commented 6 years ago

Hi, I'm using inputmask and want to set removeMaskOnSubmit = true in some inputs but it doesn´t work.

I'm using Version: 4.0.0-65, and importing de next files

`





` And doing it like this: ` $(".decimal").inputmask('decimal',{ allowPlus: false, allowMinus: false, rightAlignNumerics: false, autoGroup: true, groupSeparator: ',', digits: 2, removeMaskOnSubmit: true }); ` The mask works fine, I'm missing something?
jcmcclorey commented 4 years ago

This still appears to be broken. I am attempting to use the removeMaskOnSubmit option in a Laravel project (using Laravel Mix on Webpack). The submitEvent() seems to be getting called AFTER the form's submit event. Like @ElFitaFlores I am able to apply other options successfully, so it appears to be a bug, but I could also just be using it incorrectly.

My example is that I'm trying to use the removeMaskOnSubmit option for a phone number with the format (999) 999-9999 and when the form is submitted the NaNs are included as part of the input.

$("#main_contact_number").inputmask('(999) 999-9999', { removeMaskOnSubmit: true });

RobinHerbots commented 4 years ago

@JoeMc98 ,

Have a look at https://codepen.io/robinherbots/pen/gOraMaN You can see in the devtools the submitted value.

Probably there is an handler for submit which interferes.

jcmcclorey commented 3 years ago

@RobinHerbots thank you for explaining this. That is definitely what the problem was for me.