Skip to content
This repository was archived by the owner on Dec 11, 2017. It is now read-only.

added ability to apply transformation function to entered char on keypre...#166

Closed
Sorgor wants to merge 2 commits intodigitalBush:masterfrom
Sorgor:master
Closed

added ability to apply transformation function to entered char on keypre...#166
Sorgor wants to merge 2 commits intodigitalBush:masterfrom
Sorgor:master

Conversation

@Sorgor
Copy link

@Sorgor Sorgor commented Aug 22, 2013

Hi, I added ability to apply transformation function to entered char on keypress event.

this can be used like that:

$("#po").mask("PO: aaa-999-***", 
    {transform: function(s){
        return s.toUpperCase()
    }
});

or

$("#po").mask("PO: aaa-999-***", 
    {transform: function(s){
        if (s == 'm') return 'n';
        else return s;
    }
});

or something like that

@digitalBush
Copy link
Owner

This is a neat idea. To be really useful though, I think we might want to expose a bit more context to the callback function. I'm going to look into something like this for 2.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants