View Full Version : Textarea onchange detection

jan lee
08-28-2010, 12:34 PM

How do I detect change event on textarea using javascript?
I'm trying to detect any change, but without any type.

For example, instead to have an "onclick submit button" to copy the contents of the textarea to another file, how it can be done automatically when focos is in?

In short words, I want to submit a form without pressing a submit button!


Jan Lee

jan lee
08-28-2010, 07:03 PM

I put the following in the form, but it submit just a blank line.

<form name="MyForm" method="post" action="next.asp" >
<textarea id="PageURL" rows=20 cols=100 ></textarea>
<script type="text/javascript" language="JavaScript">
document.MyForm.PageURL.value = document.URL;

Jan Lee