Blocking input on Safari web page?

My 89-year old father-in-law is in the early stages of dementia. :frowning: Every time malware or pop-up scareware (think MacKeeper or SafeSearch search hijacker) appears on his Mac, or he receives scam emails, he whips out the credit card and pays whatever they are asking, and promptly forgets what he did. Parental controls isn’t useful because he still need Internet access. He’s getting scammed left and right.

I’m looking for an AppleScript that limits the length of a number string that users can enter on Safari (or any HTML pop-up) web pages. I’d like him to continue to enjoy the Internet but make it impossible to enter his credit card number. Does anyone know of such a beast or what commands I’d need to use? I’m not a scripter but could probably write a simple one with a little prompting. I have admin access to his computer.