【问题标题】:How to create Calender control in jsp page using Struts 1.3如何使用 Struts 1.3 在 jsp 页面中创建日历控件
【发布时间】:2013-09-13 04:50:26
【问题描述】:

我正在使用 Struts 1.3 Framework 创建一个 Web 应用程序。谁能指导我如何在 JSP 中使用 Struts 1.3 创建日历控件。

【问题讨论】:

标签: jsp calendar struts struts-1


【解决方案1】:

使用JQuery UI datepicker 非常简单。您可以将其用作input 标签或html:text,您应该提供id 属性以绑定到UI 小部件。

【讨论】:

    【解决方案2】:

    我使用Jquery Datepicker 做到了。易于集成且外观精美。

    <script type="text/javascript">
    $.datepicker.setDefaults({
      showOn: "button",
      buttonImageOnly: true,
      buttonImage: "<%=request.getContextPath() + "/images/Calendar.png"%>",
      buttonText : "Calendario"
    });
    $(function() {
        $("#fechaIni").datepicker({
            changeMonth : true,
            changeYear : true
        });
    });
    </script>
    
    <input id="fechaIni" value="<%= fechaInicial %>" />
    

    【讨论】:

      【解决方案3】:
      <html:text  property="toDate" styleClass="form-control" styleId="toDate" />
                              
      <script type="text/javascript">
              $('#toDate').datepicker({
              format: 'dd/mm/yyyy'
          });
      </script>
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2016-06-23
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多