onchange event - IE error
<p>In my code behind, I have - </p>

<pre><code>tbWhatIfBeginDate.Attributes.Add("onchange", "checkDates(" + tbWhatIfBeginDate.ClientID + ", " + tbWhatIfEndDate.ClientID + ")");
tbWhatIfEndDate.Attributes.Add("onchange", "checkDates(" + tbWhatIfBeginDate.ClientID + ", " + tbWhatIfEndDate.ClientID + ")");
</code></pre>

<p>and here is my javascript function - </p>

<pre><code>function checkDates(BeginDateId, EndDateId) {
    if (BeginDateId.value &gt; EndDateId.value) {
        var beginDt = new Date(BeginDateId.value);
        var endDt = new Date(EndDateId.value);

        var newDt = new Date(endDt.getTime() - (24 * 60 * 60 * 1000));

        var y = newDt.getFullYear(),
        m = newDt.getMonth() + 1, // january is month 0 in javascript     
        d = newDt.getDate();

        BeginDateId.value = [pad(m), pad(d), y].join("/");
    }
}
</code></pre>

<p>when I run through Visual Studio 2010, it works.</p>

<p>When I deploy to my test server, I get an error message. "Object expected - Line:176,Char:1"</p>

<p>line 176 is - 
    input name="ctl00$cpMain$tbWhatIfBeginDate" type="text" value="8/1/2012"     id="ctl00_cpMain_tbWhatIfBeginDate" onchange="checkDates    (ctl00_cpMain_tbWhatIfBeginDate, ctl00_cpMain_tbWhatIfEndDate)" style="width:70px;"</p>

<p>I don't see an error.</p>

<p>Ideas?</p>
