Detect EOL in input field

Hi!
I’m trying to do this:
i 've an input text field and i want to insert a “<br>” when i hit the “enter key”, meaning, i will read the text variable and then insert the tag each time break the line.

Then i will just pass to php and print on screen in html format. But i don’t want use the textarea component or any component.

Basically, i’m trying to understand how can i manipulate that text variable.

Bye,
MagNastiK