hi,
I have an issue for the WebDatePicker Client Events for "TextChanged" and "ValueChanged" on the Firefox and Goodle Chrome.
Here is the error message when the page is loading.
The "<Java Script Name>" for "TextChanged" should be a function, function name, or function text.
ASP Code.
<ig:WebDatePicker ID="detFirstNoticeDate" runat="server"> <ClientSideEvents ValueChanged="detFirstNoticeDate_ValueChanged" /> </ig:WebDatePicker>
Java Script Code.
function detFirstNoticeDate_ValueChanged(detFirstNoticeDate, evntArgs) { var oNoticeFlag = document.getElementById("<%=ddlNoticeStatus.ClientID%>"); var selectVal = 1; oNoticeFlag.selectedIndex = selectVal - 1; window.onbeforeunload = page_OnUnload; }
It is working on the IE, but cannot work on Firefox or Chrome.
Hi jshiu,
Could you provide the javascript code for the "TextChanged" event also?
Hi here is the JS function.
Thanks,
function detIssued_TextChanged(detIssued, evntArgs) { var SigDCDate = $find('<%=detSignatureDC.ClientID%>')._getTxt(); var SigDCText = $find('<%=ddlSignatureDC.ClientID%>').get_text(); var objStatus = document.getElementById('<%=detStatus.ClientID%>'); var selectIndex = document.getElementById('<%=detStatus.ClientID%>').selectedIndex; var selectItem = document.getElementById('<%=detStatus.ClientID%>').options[selectIndex].value; var IssuedDate = $find('<%=detIssued.ClientID%>'); var ExpiredDate = $find('<%=detExpires.ClientID%>'); var AcceptLetterDate = $find('<%=detAcceptLetterDate.ClientID%>'); var isExpReadOnly = ExpiredDate.get_readOnly(); var isAcpLetterReadOnly = AcceptLetterDate.get_readOnly(); var date = new Date(IssuedDate.get_value()); var expDate = new Date(); if (IssuedDate._old == null) { if (SigDCDate == "" || SigDCText == "") { alert("Please check and fill all of signatures and dates on the Permit Processing Issuance tab."); IssuedDate.set_text(""); } else { AcceptLetterDate.set_readOnly(false); AcceptLetterDate.set_value(date); if (date.getMonth() + 1 == 2 && date.getDate() == 29) { expDate.setFullYear(date.getFullYear() + 1, 2, 1); } else { expDate.setFullYear(date.getFullYear() + 1, date.getMonth(), date.getDate()); } ExpiredDate.set_readOnly(false); ExpiredDate.set_value(expDate); ExpiredDate.set_text(expDate); if (isAcpLetterReadOnly) { AcceptLetterDate.set_readOnly(true); } if (isExpReadOnly) { ExpiredDate.set_readOnly(true); } } } }
Maybe you are placing the JS functions inside a $(document).ready() jquery function. If you are doing this, take them out in separate <script> tags like Alexander suggested.
Regards
Hello jshiu,
Let me know if you have further questions.
I am attaching you a sample that uses “TextChanged” and “ValueChanged” event handlers and that is working in IE, Firefox, Safari and Chrome browsers without errors thrown.
Test this example and let me know if you have further questions.