Pasting multiple lines into a single line text box

A

Adam Plocher

Hello, I have an <input type="text" /> textbox that when the Enter key
is pressed, it's text gets processed by a javascript and it clears the
contents of the textbox. I was wondering if it's possible to have it
handle pasting multiple-lines of text into it, so that on every line
break it get's processed by javascript then clears the text field and
handles the next line.

I know IE has onpaste and onbeforepaste events, but I still can't see
how to do what I want with those. Any suggestions? I might be able
to use a textarea and have it mimic the behavior of a single line text
box...

Thanks
-Adam
 
J

Jonathan N. Little

Adam said:
Hello, I have an <input type="text" /> textbox that when the Enter key
is pressed, it's text gets processed by a javascript and it clears the
contents of the textbox. I was wondering if it's possible to have it
handle pasting multiple-lines of text into it, so that on every line
break it get's processed by javascript then clears the text field and
handles the next line.

I know IE has onpaste and onbeforepaste events, but I still can't see
how to do what I want with those. Any suggestions? I might be able
to use a textarea and have it mimic the behavior of a single line text
box...

?? Use the right tools for the application, especially where there is
already a tool for your needs.

textbox => single line of input
textarea => multiple lines of input
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top