It works for me. However the syntax Jeff posted is wrong. It should
be:

$(ctl).datepicker({onSelect: function() {}});

On Sep 1, 5:08 pm, tekanet <[EMAIL PROTECTED]> wrote:
> This doesn't work for me: I can't set the onSelect with that syntax, I
> tried with .bind("onSelect",function(){}) but nothing. Maybe we're
> using different components.. mine is this:
>
> http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/
>
> A further explanation will be much appreciated!
>
> On Aug 14, 11:16 pm, "Jeff J." <[EMAIL PROTECTED]> wrote:
>
> > I also experienced this error. After playing with a few things, doing
> > several searches, and getting far too technical, I discovered a simple
> > solution:
>
> > $(ctl).datepicker(onSelect: function() {});
>
> > Assigning an empty function to the datepicker's onSelect property
> > causes the validation function to not be fired on change. It still
> > fires appropriately on submit. This potentially isn't the best client
> > experience, but it's better than an error, and shouldn't be a problem
> > with the datepicker setting the value.
>
> > ~ Jeff J.
>
> > On Jul 29, 6:15 am, Patrick J Collins <[EMAIL PROTECTED]>
> > wrote:
>
> > > Hello everyone,
>
> > > I'm experiencing a clash between jQuery UI datepicker 1.5.2 and an
> > > ASP.net 3.5 CustomValidator.  The problem occurs in Internet Explorer
> > > 7.0, not in Firefox 2.0.  When I change the date using the little drop
> > > down calendar, IE throws the following error:
>
> > > Line 172 'length' has a null value or is not an object
>
> > > I did a bit of debugging in both IE and Firefox.  Now, in
> > > ui.datepicker.js on line 730, the change event is automatically
> > > triggered once the user selects a day:
>
> > > else if (inst.input)
> > > inst.input.trigger('change'); // fire the change event
>
> > > From there, jquery.js on line 2020 triggers the actual event:
>
> > > if ( (!fn || (jQuery.nodeName(elem, 'a') && type == "click")) &&
> > > elem["on"+type] && elem["on"+type].apply( elem, data ) === false )
> > >                                 val = false;
>
> > > And finally we wind up in the ASP.net javascript, to which I have
> > > added a few comments.
>
> > > function ValidatorOnChange(event) {
> > >     if (!event) {
> > >         event = window.event;
> > >     }
> > >     Page_InvalidControlToBeFocused = null;
> > >     var targetedControl;
> > >     if ((typeof(event.srcElement) != "undefined") &&
> > > (event.srcElement != null)) {
>
> > > // Internet Explorer always enters this branch.  event.srcElement
> > > contains a reference to an
> > > // anchor (tagName = “A”)
>
> > >         targetedControl = event.srcElement;
> > >     }
> > >     else {
>
> > > // Firefox always enters this branch.  event.target contains a
> > > reference to the input box.
>
> > >         targetedControl = event.target;
> > >     }
> > >     var vals;
> > >     if (typeof(targetedControl.Validators) != "undefined") {
> > >         vals = targetedControl.Validators;
> > >     }
> > >     else {
> > >         if (targetedControl.tagName.toLowerCase() == "label") {
> > >             targetedControl =
> > > document.getElementById(targetedControl.htmlFor);
> > >             vals = targetedControl.Validators;
> > >         }
> > >     }
> > >     var i;
>
> > > // Internet Explorer fails on this line, as vals is undefined.
>
> > >     for (i = 0; i < vals.length; i++) {
> > >         ValidatorValidate(vals[i], null, event);
> > >     }
> > >     ValidatorUpdateIsValid();
>
> > > }
>
> > > I'm afraid I don't really understand javascript well enough to
> > > determine the reason for the difference in behavior.  Could anyone
> > > else suggest why this is happening?
>
> > > After some Googling, I discovered this forum post which hints at a
> > > similar problem:
>
> > >http://www.zapatec.com/website/forums/viewtopic.php?t=164
>
> > > I refer specifically to jahoog's post where he says: "It seems the
> > > problem in IE is that the '.onchange()' syntax does not pass the event
> > > information correctly."
>
> > > Could that perhaps be the problem here?
>
> > > Must appreciated,
>
> > > Patrick Collins
> > > France

Reply via email to