Disabled backspace and attempted len variable reset

Succesfully disabled backspace key. Cannot reset 'len' variable to 0. I
think that using $(this).val().length; may make reseting to 0 and then
counting again difficult? Also, how do I reset the variable 'len'
outside of the function where it is used?