<p>I have the following problem:</p>

<p>I have an HTML textbox (<code>&lt;input type="text"&gt;</code>) whose contents are modified by a script I cannot touch (it is my page, but i'm using external components).</p>

<p>I want to be notified in my script every time the value of that textbox changes, so I can react to it.</p>

<p>I've tried this:</p>

<pre><code>txtStartDate.observe('change', function() { alert('change' +  txtStartDate.value) });
</code></pre>

<p>which (predictably) doesn't work. It only gets executed if I myself change the textbox value with the keyboard and then move the focus elsewhere, but it doesn't get executed if the script changes the value.</p>

<p>Is there another event I can listen to, that i'm not aware of?</p>

<p><br /><br /></p>

<p>I'm using the Prototype library, and in case it's relevant, the external component modifying the textbox value is Basic Date Picker (www.basicdatepicker.com) </p>

As you've implied, change (and other events) only fire when the user takes some action. A script modifying things won't fire any events.  Your only solution is to find some hook into the control that you can hook up to your listener.
Here is how I would do it:
```
```
basicDatePicker.selectDate = basicDatePicker.selectDate.wrap(function(orig,year,month,day,hide) {
  myListener(year,month,day);
  return orig(year,month,day,hide);
});
```
```
That's based on a cursory look with Firebug (I'm not familiar with the component). If there are other ways of selecting a date, then you'll need to wrap those methods as well.