日历扩展程序弹出窗口无法使用谷歌浏览器

时间:2015-06-10 07:38:27

标签: javascript .net google-chrome

弹出扩展程序代码

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
  <TABLE id="Table3" cellpadding="5" cellspacing="1" border="0" style="float:left; " bgcolor="#eeeeee" class="main"> 
      <TBODY>
      <tr bgcolor="#ffffff">
      <td  class="main" valign="top" align="left" >
      <FONT  >Select Mode</FONT>
      </td>
       <td  id="Td6" runat="server"  class="main" valign="top" align="left" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
       <asp:DropDownList id="ddlmode" runat="server" onselectedindexchanged="ddlmode_SelectedIndexChanged" EnableViewState="true" AutoPostBack="true" Width="180px">
                           <%-- <asp:ListItem Text="Select Mode of Payment" Value="0"></asp:ListItem>--%>
                            <asp:ListItem Text="Cash" Value="1"></asp:ListItem>
                            <asp:ListItem Text="Cheque" Value="2"></asp:ListItem>
                            <asp:ListItem Text="DD" Value="3"></asp:ListItem>
                            <asp:ListItem Text="Credit/debit Card" Value="4"></asp:ListItem>
                            <asp:ListItem Text="NEFT/RTGS" Value="5"></asp:ListItem>
                            <asp:ListItem Text="Credit Note Adj" Value="6"></asp:ListItem>
                             <asp:ListItem Text="Advance Payment Adj" Value="7"></asp:ListItem>
                        </asp:DropDownList> </td>
                        </tr>

                            <tr id="ROW3" runat="server" visible="false" bgcolor="#ffffff">
                                 <td class="main" align="left">
                                    <asp:Label id="Lab4" runat="server" Text="Cheque Date: "></asp:Label>
                                    </td>
                                 <td valign="top" align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
                                     <asp:TextBox id="txtFromDate" runat="server" CssClass="textbox" MaxLength="11" Width="128px" ></asp:TextBox> 
                                     <asp:Image style="CURSOR: pointer" id="ImaArr1" runat="server" ImageUrl="./images/CAL.GIF"></asp:Image> 
                                     <cc1:CalendarExtender id="CalendarExtender2" runat="server" CssClass="yui" TargetControlID="txtFromDate" PopupButtonID="ImaArr1" Format="dd-MMM-yyyy">
                                    </cc1:CalendarExtender>
                                    <asp:RequiredFieldValidator id="ReqChequedate" runat="server" ControlToValidate="txtFromDate" ErrorMessage="Enter Cheque date." SetFocusOnError="True" ValidationGroup="tripSheet"  >*</asp:RequiredFieldValidator>
                                    <asp:CustomValidator ID="CustxtFromDate"  runat="server"  ClientValidationFunction="CallDateFunForFromDate" ControlToValidate="txtFromDate"  ValidationGroup="tripSheet" errormessage="Invalid Cheque Date." style="vertical-align:top;">*</asp:CustomValidator>
                                    </td>
                           </tr>

                            <tr id="ROW5" runat="server" visible="false" bgcolor="#ffffff">
                                <td class="main" align="left">
                                    <asp:Label id="Lab6" runat="server" Text="Card Date: "></asp:Label>
                                </td>
                                <td valign="top" align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
                               <asp:TextBox id="TxtCardDte" runat="server" CssClass="textbox" MaxLength="11" Width="128px" ></asp:TextBox> 
                                 <asp:Image style="CURSOR: pointer" id="ImaArr" runat="server" ImageUrl="./images/CAL.GIF"></asp:Image> 
                                 <cc1:CalendarExtender id="CalendarExtender1" runat="server" CssClass="yui" TargetControlID="TxtCardDte" PopupButtonID="ImaArr" Format="dd-MMM-yyyy">
                                </cc1:CalendarExtender>
                                <asp:RequiredFieldValidator id="RFVArrivalDate" runat="server" ControlToValidate="TxtCardDte" ErrorMessage="Enter Card date" SetFocusOnError="True" ValidationGroup="tripSheet">*</asp:RequiredFieldValidator>
                                <asp:CustomValidator ID="CusValCtrToDate"  runat="server"  ClientValidationFunction="CallDateFunForToDate" ControlToValidate="TxtCardDte"  ValidationGroup="tripSheet" errormessage="Invalid cheque Date." style="vertical-align:top;">*</asp:CustomValidator>
                                </td>
                            </tr>

                            <tr id="ROW7" runat="server" visible="false" bgcolor="#ffffff">
                                <td class="main" align="left">
                                    <asp:Label id="Lab8" runat="server" Text="Discount: "></asp:Label> 
                                 </td>
                                  <td valign="top" align="left">
                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
                                        <asp:TextBox id="TxtDiscnt" runat="server" MaxLength="20" cssclass="textbox"></asp:TextBox>
                                       </td>
                            </tr>

                            <tr id="ROW9" runat="server" visible="false" bgcolor="#ffffff">
                                     <td class="main" align="left">
                                         <asp:Label id="Labl0" runat="server" Text="UTR: "></asp:Label> 
                                    </td>
                                    <td valign="top" align="left">
                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <asp:TextBox id="TxtUtr" runat="server" MaxLength="20" cssclass="textbox"></asp:TextBox> 
                                        <asp:RequiredFieldValidator id="ReqUtr" runat="server" ControlToValidate="TxtUtr" ErrorMessage="Enter UTR No. " SetFocusOnError="True" ValidationGroup="tripSheet"  >*</asp:RequiredFieldValidator>
                                        <asp:RegularExpressionValidator ID="regUtr" ControlToValidate="TxtUtr" runat="server" SetFocusOnError="true" ErrorMessage="Please Enter Valid UTR No. " ValidationGroup="tripSheet" ValidationExpression="^\d+$"></asp:RegularExpressionValidator>
                                        </td>
                            </tr>
                            <tr id="ROW10" runat="server" visible="false" bgcolor="#ffffff">
                                     <td class="main" align="left">
                                         <asp:Label id="Labl1" runat="server" Text="Ref No: "></asp:Label> 
                                    </td>
                                    <td valign="top" align="left">
                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <asp:TextBox id="TxtRefno" runat="server" MaxLength="20" cssclass="textbox"></asp:TextBox> 
                                        </td>

                            </tr>
                            <tr id="RowBtn" runat="server" visible="false" bgcolor="#ffffff">
                                <td ></td>
                                <td  colspan="2" >
                                 <asp:Button ID="BtnAdd" runat="server" Text="Add" CssClass="button" ValidationGroup="tripSheet"  />
                                <asp:ValidationSummary ID="VS" runat="server" ShowMessageBox="true"  ShowSummary="false" ValidationGroup="tripSheet"/>

                            </TBODY></TABLE>

JavaScript codes

<script language="javascript" type ="text/javascript">       
         function IsValidDate(Day,Mn,Yr)
         {
            var DateVal = Mn +"/" + Day +"/" + Yr;
            var dt = new Date(DateVal);

            if(dt.getDate()!=Day)
                {
                return(false);
                }
            else if(dt.getMonth()!=Mn-1)
                {
                return(false);
                }
            else if(dt.getFullYear()!=Yr)
                {
                return(false);
                }                
            return(true);
         }         
         function CallDateFunForToDate(sender, args)
         {            
            var date=document.getElementById("ctl00_ContentPlaceHolder1_TxtCardDte").value
            var dat=date.substring(0,2)
            var m=date.substring(3,6)
            var y=date.substring(7,11)
            var d
            if(m=='Jan')
            {
                d=1
            }
            else if (m=='Feb')
            {
                d=2
            }
            else if (m=='Mar')
            {
                d=3
            }
            else if (m=='Apr')
            {   
                d=4
            }
           ...                  
        }
        function CallDateFunForFromDate(sender, args)
         {            
            var date=document.getElementById("ctl00_ContentPlaceHolder1_txtFromDate").value
            var dat=date.substring(0,2)
            var m=date.substring(3,6)
            var y=date.substring(7,11)
            var d
           ...
            else if (m=='Dec')
            {
                d=12
            }
            if(IsValidDate(dat,d,y))
                args.IsValid=true;
            else
                args.IsValid=false;    
        }



           function loadCurrent()
{
      document.getElementById("ctl00_ContentPlaceHolder1_TxtCancelReason").value="";
     $("#ctl00_ContentPlaceHolder1_PanelCurrent").css("display","block");
     $find("modalpopupCurrent").show();

}
</script>

脚本管理器是在主页面内定义的,我遇到的问题是我无法看到日历,但只有当我使用谷歌浏览器时才会看到。我尝试使用堆栈答案,但我无法解决它。甚至一些正则表达也不能正常工作 我该如何解决这个问题?

0 个答案:

没有答案