Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

DatePicker with struts

Options
  • 27-05-2005 10:32am
    #1
    Closed Accounts Posts: 73 ✭✭


    Trying to implement a datepicker in struts.I down loaded the date picker off the net and tried to implement it in my jsp. It works fine ouside the struts form tags but inside nothing happens and i get an "error on page" message. Thanks in advance.

    (Code)
    <html>
    <head>
    <title></title>
    <SCRIPT LANGUAGE="JavaScript" SRC="CalendarPopup.js"></SCRIPT>
    <SCRIPT LANGUAGE="JavaScript">
    var cal = new CalendarPopup();
    </SCRIPT>
    </head>
    <body bgcolor="#FFFFFF">
    <html:form action="projectadd">
    <table>
    <tr>
    <td>
    Date
    </td>
    <td>
    <html:text property="date1" size="30" maxlength="60"/>
    <A HREF="#"
    onClick="cal.select(document.forms.date1,'anchor1','MM/dd/yyyy'); return false;"
    NAME="anchor1" ID="anchor1">select</A>
    </td>
    </tr>
    </table>
    </html:form>
    <FORM NAME="example">
    <br>
    <INPUT TYPE="text" NAME="date1" VALUE="" SIZE=25>
    <A HREF="#"
    onClick="cal.select(document.forms.date1,'anchor1','MM/dd/yyyy'); return false;"
    NAME="anchor1" ID="anchor1">select</A>
    </FORM>


    </body>
    </html>


Comments

  • Closed Accounts Posts: 133 ✭✭Jim Kernsey


    use the styleid tag like so

    where you have

    <html:text property="date1" size="30" maxlength="60"/>

    change it to

    <html:text property="date1" size="30" maxlength="60" styleId="date1"/>

    I'm assuming date1 is the name of the calander.


    JK


Advertisement