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
1740
element.defaultValue property is not initialized correctly
posted

The defaultValue property is not initialized for the WebDatePicker control. The control is initialized from the code-behind in the page_load event but the element.defaultValue is empty.


We have a generic javascript "form is dirty" implementation that checks if anything has changed in the browser.

This check always return true in the javascript function.

if (type == "hidden" || type == "password" || type == "text" || type == "textarea" || type == "file") {
            if (element.value != element.defaultValue) {
                return true;
            }       }

Is there a way to set the defaultValue to the value initalized in the code-behind?

Here is my HTML for the control - 


<ig:WebDatePicker ID="StartDateWebDatePicker" runat="server">
</ig:WebDatePicker>