Hello,
I need to capture the web Date Picker selected value and use it in the javascript for validation purpose.
I am using the following code to ge the value, but I am getting error (Microsoft JScript runtime error: Object expected)
var
SartDate = '<%=StartDate.ClientID %>';
var frm1 = igdrp_getComboById(StartDate);
Any suggestions please.
Thanks in Advance
Hi,
It is not clear which control you refer to and what you mean under selected value.Considering codesvar frm1 = igdrp_getComboById(StartDate);you probably use WebDateChooser, but not WebDatePicker.None of those controls have concept of selected value. They have only value (or text) which currently appears in edit field. Both of them also have method which returns part of selected string in edit field, but that is probably not what you ask for.
If you want to know new selected date in drop-down calendar of WebDateChooser when it was dropped, then I can suggest you to process CalendarValueChanging event. Below is example:
<script type="text/javascript">function dc1_CalendarValueChanging(oCalendar, oDate, oEvent){ if(window.confirm('update?')) return; oEvent.cancel = true; var dc = igdrp_getComboById('<%=WebDateChooser1.ClientID%>');// dc.setDropDownVisible(false); dc.hideCalendar();}</script><igsch:WebDateChooser ID="WebDateChooser1" runat="server"> <ClientSideEvents CalendarValueChanging="dc1_CalendarValueChanging"> </ClientSideEvents></igsch:WebDateChooser>
upgrading from webdateshooseer to webdatepicker , what shuld the following code me replaced with in WebDatepicker?
var fromDateControl = igdrp_getComboById(StartDateId);