Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to apply if else loop to the filter #28

Closed
Dhrumilkp opened this issue Jul 8, 2019 · 1 comment
Closed

How to apply if else loop to the filter #28

Dhrumilkp opened this issue Jul 8, 2019 · 1 comment

Comments

@Dhrumilkp
Copy link

I am not an expert here, but i want to know how can i add if else so in case if there is swear in the line it will disabled the button and enable after a check if there is not swear words

@ChaseFlorell
Copy link
Owner

If you look at the demo, there's a callback function that is invoked around the profaneText.

// code:
$('#five').profanityFilter({
    customSwears: ['ass'],
    filter: true,
    externalSwears: 'swearWords.json',
    profaneText: function(data) {
        $('#five')
            .css('color', 'blue');
            console.log(data);
    }
});

you can do whatever you like within the callback, so I suggest just disabling the button in there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants