Today I've spent an hour trying to figure out how to use custom filtering on a JForm field. I knew that it was possible, but I just didn't know how. Searching on google also didn't help much. The question was asked a year ago on stackoverflow and nobody has answered it yet.
So, I decided that I'll have to look in the code and figure this on my own. Why would you want to do custom filtering? In my case users had to submit percentages in a field. The values were stored in the database as double, so I had to make sure that values submitted for example with comma, were properly saved in the database. What I've done in the past (and I'm ashamed to acknowledge this) is overriding the controller's save function, making the changes to the form data and passing the modified data to back to JForm. Well, it works, but in this project I wanted to save time & finally do it the correct way.