New function that detects and alerts 'enter' keypress

Struggling to get the 'enter' keypress to reset the variable len to 0.