Calendar popup into Struts!

Posted on 2006-05-24
Last Modified: 2008-01-09
I hava Calendar popup javascript. In hml page, to display Calendar is very easy because it display over name of form. But in Struts, how to display Calendar?
Following code in Html page:
<form method="post" name="tstest">
     <input type="text" name="price">
    <a href="javascript:cal5.popup();"><img border="0"  src="img/cal.gif" width="16" height="16">

<script language="JavaScript">
<!-- // create calendar object(s) juWst after form tag closed
// specify form element as the only parameter (document.forms['formname'].elements['inputname']);
// note: you can have as many calendar objects as you need for your application

var cal5 = new calendar2(document.forms['tstest'].elements['price']);
cal5.year_scroll = true;
cal5.time_comp = false;
Please help me!
Question by:khoa235
    1 Comment
    LVL 14

    Accepted Solution

    The form bean name is the form name and the field "property" is the field name.

    <html:form method="post" action="">
         <html:text property="price">
        <a href="javascript:cal5.popup();"><img border="0"  src="img/cal.gif" width="16" height="16">
    <script language="JavaScript">
    <!-- //
    var cal5 = new calendar2(document.forms['testForm'].elements['price']);
    cal5.year_scroll = true;
    cal5.time_comp = false;


    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
    If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now