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
2320
WebDateTimeEdit Set Value via ClientSide script
posted

I have 2 WebDateTimeEdit controls on my control.  When the user sets the first control initially I want to default in the same value into the second datetimeedit control.  I can set the value property of the second control but I can't get it to display the new value on the control.

Here is my clientside script which is fired in the controls ValueChange event.  What am I doing wrong?

 var toDate = document.getElementById(wdtToDate.ClientID);
 var fromDateEdit = document.getElementById(wdtFromDate.ClientID);
    if (toDate.value == '')
    {
        toDate.value = fromDateEdit.value;
        toDate.innerText = fromDateEdit.value;
    }

The value is getting set but nothing is displaying in the ToDate WebDateTimeEdit control.  So I tried setting innerText also, it didn't work.