Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
125
WebDatePicker set_value not putting in correct value
posted

I have a WebDatePicker on my page. In the client side, I need to set the value. I have the following code in place which I call by sending in the ID of the date picker and the value I want it set to:

function setOpenerDate(id, value)
{
    var dt= new Date(value);
    var datepicker= window.opener.$find(id);
    alert('value=' + datepicker.get_value());
    datepicker.set_value(dt);
    alert('value=' + datepicker.get_value());
}

The value I'm sending in for testing is "5/9/2013". I've verified that the grabbing of the WebDatePicker is successful. As you can see, I have two alerts. The first one comes back "value=null" (which is expected, since I never set the value while building the page). But, the second one always comes back "value=Thu Jun 05 2014 00:00:00 GMT-0500 (Central Standard Time)" (it happens to be the 5th right now, so I'm assuming it is just getting set as the current date). I also previously had an alert to show me the value of "dt", which comes back as "value=Thu May 09 2013 00:00:00 GMT-0500 (Central Standard Time)", so I know the date is being set properly. Can you see what could be going wrong here? Thanks!

We are on version 13.2.20132.2028 and using .NET Framework 4.5.

Parents
No Data
Reply
  • 29417
    Offline posted

    Hello Dave,

     Thank you for posting in our forum. 

    I’ve tested this on my side and the method set_value seems to work as expected on my side.

    Could you let me know on which event you’re calling that method? 

    I’ve attached a sample for your reference where on a button’s click event the value gets set to "5/9/2013" and it seems to work as expected.

    Please test it on your side and let me know if you’re getting a different result.

    If the value is not getting set as expected please let me know on which browser you’re getting the incorrect behavior.

    If the sample is not an accurate demonstration of what you’re doing, please feel free to modify it and send it back.

     I’m looking forward to your reply. 

     

    Best Regards,

    Maya Kirova

    Developer Support Engineer II

    Infragistics, Inc.

    http://ko.infragistics.com/support

     

    wdp_setValue.zip
Children