Your method looks just fine, and should work correctly. There was one small typo that you left out the EventObjecte from the delegated event binder ( but included it in the direct event binder, which is why it worked ).

Changing the first line to:

$(document).on('keydown', '.numberOnly', function(e) {

should fix your problem

Email codedump link for How can I force numbers only on a dynamically created field?