[Custom Input Masks] Issue when Option KeepMask is set to false and component Refresh
Question
Forge component by Sara Gonçalves

Hi,

I was using this component and notice that every time I refreshed the component and input after an ajax submit with client validation, the value that is being submitted in that input is 100x bigger than the original value.

For my analysis, the action is being performed twice for the same submit, which generates this bug.

        $(elementID).inputmask('remove');

This action is being executed when the client form validation function is executed and before submit, both

        var Base_OsPage_ClientValidate = OsPage_ClientValidate;
        OsPage_ClientValidate = (function (srcElement, cleanOnlySrcElementErrors) {
            $(elementID).inputmask('remove');
            var result = Base_OsPage_ClientValidate(srcElement, cleanOnlySrcElementErrors);
            $(elementID).inputmask(mask, maskOpts);
            return result;
        });

        osAjaxBackend.BindBeforeSubmit(function () {
            $(elementID).inputmask('remove');
        });

And I thought invoking that action twice was making this happening, but the issue is generated by invoking 

        $(elementID).inputmask(mask, maskOpts);

I edited the component, and the issue was fixed by removing that code line from the validation function.

Cheers,

João Franco

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.