I am using jquery.inputmask.js in my project as
$("#SSN").inputmask({
"mask": "999-99-9999", 'autoUnmask': true,
onUnMask: function (value) {
return value.replace('-', '');
}
});
It works great on display. But when I submit this model and read the values in the controller, it still gives 999-99-9999 instead of 999999999.
I do not want to read each value and replace it as
Model.SSN.Replace('-','')
before saving. Please, help.
Thank!!!!
EDIT:
When I read $("#SSN").val()in jquery, it returns the format 999999999, but not in the controller (C #).
source
share