• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 727
  • Last Modified:

Calendar popup into Struts!

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">

</form>
<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;
//-->
</script>
Please help me!
0
khoa235
Asked:
khoa235
1 Solution
 
boonlengCommented:
The form bean name is the form name and the field "property" is the field name.

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

0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now