Jquery UI DatePicker IE problem - Validators Interfering

ASP.Net 3.5 Application.

Date picker shows and when i try to click the date, IE 8 (I havent checked other versions) throws “length is null or not an object” error. It puts the date in the text box but then throws error. When i click out side the date picker area, it hides properly without any error. FF behaves properly.

Error is on the following line in generated webresource_3.axd file (line # 175). When i take out all 3 validators then it works normal.


 [COLOR=blue]var[/COLOR] i;
    [COLOR=blue]for[/COLOR] (i = 0; i < [B]vals.length[/B]; i++) {
        ValidatorValidate(vals[i], [COLOR=blue]null[/COLOR], event);
    }

Page code:

Head References


[COLOR=#0000ff]<[/COLOR][COLOR=#800000]script[/COLOR][COLOR=#ff0000]src[/COLOR][COLOR=#0000ff]="Scripts/jquery-1.6.2.min.js" [/COLOR][COLOR=#ff0000]type[/COLOR][COLOR=#0000ff]="text/javascript">[/COLOR][COLOR=#0000ff]</[/COLOR][COLOR=#800000]script[/COLOR][COLOR=#0000ff]>[/COLOR]
[COLOR=#0000ff]<[/COLOR][COLOR=#800000]link[/COLOR][COLOR=#ff0000]href[/COLOR][COLOR=#0000ff]="Scripts/jquery.ui/jquery-ui-1.8.7.custom.css" [/COLOR][COLOR=#ff0000]rel[/COLOR][COLOR=#0000ff]="stylesheet" [/COLOR][COLOR=#ff0000]type[/COLOR][COLOR=#0000ff]="text/css" />[/COLOR]

[COLOR=#0000ff]<[/COLOR][COLOR=#800000]script[/COLOR][COLOR=#ff0000]src[/COLOR][COLOR=#0000ff]="Scripts/jquery.ui/jquery-ui-1.8.7.custom.js" [/COLOR][COLOR=#ff0000]type[/COLOR][COLOR=#0000ff]="text/javascript">[/COLOR][COLOR=#0000ff]</[/COLOR][COLOR=#800000]script[/COLOR][COLOR=#0000ff]>[/COLOR]

Page HTML


[COLOR=#0000ff]<[/COLOR][COLOR=#800000]table[/COLOR][COLOR=#ff0000]id[/COLOR][COLOR=#0000ff]="tbl_control" [/COLOR][COLOR=#ff0000]cellspacing[/COLOR][COLOR=#0000ff]="0" [/COLOR][COLOR=#ff0000]cellpadding[/COLOR][COLOR=#0000ff]="0" [/COLOR][COLOR=#ff0000]border[/COLOR][COLOR=#0000ff]="0">[/COLOR]
[COLOR=#0000ff]<[/COLOR][COLOR=#800000]tr[/COLOR][COLOR=#0000ff]>[/COLOR]
[COLOR=#0000ff]<[/COLOR][COLOR=#800000]td[/COLOR][COLOR=#ff0000]align[/COLOR][COLOR=#0000ff]="center">[/COLOR]
[COLOR=#0000ff]<[/COLOR][COLOR=#800000]input[/COLOR][COLOR=#ff0000]name[/COLOR][COLOR=#0000ff]="ctl00$ContentPlaceHolder1$dtStartDate$txtDate" [/COLOR][COLOR=#ff0000]type[/COLOR][COLOR=#0000ff]="text" [/COLOR][COLOR=#ff0000]value[/COLOR][COLOR=#0000ff]="08/05/2011" [/COLOR][COLOR=#ff0000]size[/COLOR][COLOR=#0000ff]="12" [/COLOR][COLOR=#ff0000]id[/COLOR][COLOR=#0000ff]="ctl00_ContentPlaceHolder1_dtStartDate_txtDate" [/COLOR][COLOR=#ff0000]class[/COLOR][COLOR=#0000ff]="StandardText" />[/COLOR]
  [COLOR=#0000ff]</[/COLOR][COLOR=#800000]td[/COLOR][COLOR=#0000ff]>[/COLOR]
[COLOR=#0000ff]<[/COLOR][COLOR=#800000]td[/COLOR][COLOR=#ff0000]align[/COLOR][COLOR=#0000ff]="center">[/COLOR]
[COLOR=#0000ff]<[/COLOR][COLOR=#800000]span[/COLOR][COLOR=#ff0000]id[/COLOR][COLOR=#0000ff]="ctl00_ContentPlaceHolder1_dtStartDate_RegularExpressionValidator1" [/COLOR][COLOR=#ff0000]class[/COLOR][COLOR=#0000ff]="StandardText" [/COLOR][COLOR=#ff0000]style[/COLOR][COLOR=#0000ff]="color:Red;display:none;">[/COLOR]Enter valid Date[COLOR=#0000ff]</[/COLOR][COLOR=#800000]span[/COLOR][COLOR=#0000ff]>[/COLOR]
[COLOR=#0000ff]<[/COLOR][COLOR=#800000]span[/COLOR][COLOR=#ff0000]id[/COLOR][COLOR=#0000ff]="ctl00_ContentPlaceHolder1_dtStartDate_CompareValidator1" [/COLOR][COLOR=#ff0000]class[/COLOR][COLOR=#0000ff]="StandardText" [/COLOR][COLOR=#ff0000]style[/COLOR][COLOR=#0000ff]="color:Red;display:none;">[/COLOR]*[COLOR=#0000ff]</[/COLOR][COLOR=#800000]span[/COLOR][COLOR=#0000ff]>[/COLOR]
[COLOR=#0000ff]<[/COLOR][COLOR=#800000]span[/COLOR][COLOR=#ff0000]id[/COLOR][COLOR=#0000ff]="ctl00_ContentPlaceHolder1_dtStartDate_RequiredFieldValidator1" [/COLOR][COLOR=#ff0000]class[/COLOR][COLOR=#0000ff]="StandardText" [/COLOR][COLOR=#ff0000]style[/COLOR][COLOR=#0000ff]="color:Red;display:none;">[/COLOR]Date should not be blank[COLOR=#0000ff]</[/COLOR][COLOR=#800000]span[/COLOR][COLOR=#0000ff]>[/COLOR]
[COLOR=#0000ff]</[/COLOR][COLOR=#800000]td[/COLOR][COLOR=#0000ff]>[/COLOR]
[COLOR=#0000ff]</[/COLOR][COLOR=#800000]tr[/COLOR][COLOR=#0000ff]>[/COLOR]

[COLOR=#0000ff]</[/COLOR][COLOR=#800000]table[/COLOR][COLOR=#0000ff]>[/COLOR]


javascript: ClientID and ResolveUrl utilized to get text box id and image path.


[COLOR=#0000ff]<[/COLOR][COLOR=#800000]script[/COLOR][COLOR=#ff0000]type[/COLOR][COLOR=#0000ff]="text/javascript">[/COLOR] 
$(document).ready([COLOR=#0000ff]function[/COLOR]() {[INDENT]$([COLOR=#800000]".ui-datepicker-trigger"[/COLOR]).show();
$([COLOR=#800000]'#ctl00_ContentPlaceHolder1_dtStartDate_txtDate'[/COLOR]).datepicker({[/INDENT]
[INDENT=2]showOn: [COLOR=#800000]'button'[/COLOR],
buttonImage: [COLOR=#800000]'/Source/images/SmallCalendar.gif'[/COLOR],
buttonImageOnly: true[/INDENT]
[INDENT]});[/INDENT]
});
[COLOR=#0000ff]</[/COLOR][COLOR=#800000]script[/COLOR][COLOR=#0000ff]>[/COLOR]


I have also implemented the following and it is resulting in the same problem also:
http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/

If the day clicked and showing in the text box are the same then i don’t have this problem.