Hi
I want to clear the value of Webdatechooser in javascript button click .When i assign the value to null it is not taking newly assigned value but it is taking old selected value.When i change using server side event it is taking the changed value.Please help me why the value is not changing in client side
Hi,
WebDatePicker is completely different control. It extends AJAX and uses naming convensions of its base class.
It base class has the $find(ClientID) method to get reference to javascript object. Member functions which represent "property", use get_/set_ prefixes.
So, your codes would look like
var datePicker = $find('<%=WedDatePicker1.ClientID%>');var date = null; // new Date(2010, 7, 9);datePicker.set_value(date);
But the same igdrp_getComboById('ControlID').setValue(null)
does not work for WebDatePicker control. What is the replacement?
Please help...
I tested following and it worked for me.
<script type="text/javascript">function clearValue(){ var dc = igdrp_getComboById('<%=WebDateChooser1.ClientID%>'); dc.setValue(null);}</script><igsch:WebDateChooser ID="WebDateChooser1" runat="server"></igsch:WebDateChooser><input type="button" value="clear" onclick="clearValue()" />