• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Calendar with Struts

 
S Krishnan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi...
I have some problems with Calendar in Struts.
I could get the JavaScript calendar in ordinary jsp, but I am not able to get it working with the Struts tag library. Kindly help me with this. The code I used is;

-----------------------------------------------------------------------
<script type="text/javascript" src="calendar.js" />
<script type="text/javascript" src="calendar-en.js" />
<script type="text/javascript" src="calendar-setup.js" />
<script type="text/javascript">
Calendar.setup({
inputField : "f_date_b",
ifFormat : "%m/%d/%Y %I:%M %p",
showsTime : true,
button : "f_trigger_b",
singleClick : false,
step : 1
});
</script>

<html:form action="/Test.do" name="testForm"
type="Example.TestForm" >
<html:text property="date" styleId="f_date_b" />
<html:button property="button" styleId="f_trigger_b">...</html:button>
</html:form>

-----------------------------------------------------------------------

Though I am able to get the required lay out, nothing happens when i click the date button. Is there anything else that I need to do.

Please help me clear this.
Thanks,
SK

[ August 22, 2005: Message edited by: S Krishnan ]
[ August 22, 2005: Message edited by: S Krishnan ]
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One suggestion I would make is that you may want to look at the input field name. If you're using a struts tag, the name of the field may not be what you expect it to be. To find out the name used by the actual rendered HTML tags, display the page and use your browser's "View Source" function to see the actual HTML. Then verify that you are using the right name field in your calendar javaScript.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic