【问题标题】:single ajax Calendar extender for mutiple textbox and image controls?用于多个文本框和图像控件的单个 ajax 日历扩展器?
【发布时间】:2011-04-11 05:44:21
【问题描述】:

我正在为多个文本框和(日历)图像控件寻找单个 ajax 日历扩展器?

我们该怎么做呢?我在下面找到了关于文本框(不是日历图像)控件的好文章。

请帮助我也使用图像控件来获得此功能

link text

【问题讨论】:

    标签: javascript asp.net jquery asp.net-ajax


    【解决方案1】:
    <script type="text/javascript" language="javascript">
                function onlybackbutton(id) {                  
    
                      if (id == 1) {
                            document.getElementById('<%=txtCdatefrom.ClientID%>').value = "";
                            document.getElementById('<%=imgdatefrom.ClientID%>').click();
                      }
                      else if (id == 2) {
                            document.getElementById('<%=txtCdateTo.ClientID%>').value = "";
                            document.getElementById('<%=imgdateto.ClientID%>').click();
                      }
                      return false;
                }
    
          </script>
    
    
    
    <table>
    <tr>
                                              <td>
                                                    Created Date From
                                              </td>
                                              <td>
                                                    <asp:TextBox ID="txtCdatefrom" runat="server" Width="180px" onpaste="return false;" onmousedown="return onlybackbutton(1);" onkeypress="return onlybackbutton(1);"></asp:TextBox>
                                                    <asp:ImageButton ID="imgdatefrom" runat="server" ImageUrl="~/images/DatePicker.gif"
                                                          ImageAlign="Baseline" Height="16px" />
                                                    <asp:CalendarExtender ID="calsearchdtfrm" runat="server" Enabled="True" TargetControlID="txtCdatefrom"
                                                          Format="yyyy/MM/dd" PopupButtonID="imgdatefrom">
                                                    </asp:CalendarExtender>
                                              </td>
                                              <td>
                                                    Created Date To
                                              </td>
                                              <td>
                                                    <asp:TextBox ID="txtCdateTo" runat="server" Width="180px" onpaste="return false;" onmousedown="return onlybackbutton(2);" onkeypress="return onlybackbutton(2);"></asp:TextBox>
                                                    <asp:ImageButton ID="imgdateto" runat="server" Height="16px" ImageUrl="~/images/DatePicker.gif" />
                                                    <asp:CalendarExtender ID="txtsearchdtto_CalendarExtender" runat="server" Enabled="True"
                                                          TargetControlID="txtCdateTo" Format="yyyy/MM/dd" PopupButtonID="imgdateto">
                                                    </asp:CalendarExtender>
                                              </td>
                                        </tr></table>
    

    【讨论】:

      【解决方案2】:

      Obout 有一个非常棒的库,其中包含一个 AJAX Calendar 控件。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-11-11
        • 1970-01-01
        • 2011-10-07
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多