Topic: Require user to type the world 'DELETE' on deletion confirm dialog box

Does anyone know of a way or has anyone successfully implemented a way to require the user to type a word (lets say 'DELETE') on a deletion confirmation dialog?

This might be more javascript.

The app I'm working with is rails 2. However I'd be interested in seeing code for any version of rails if you have any ideas.