Posts Tagged ‘datepicker in struts’

How to use datepicker in struts 1

Monday, February 22nd, 2010

I spend a lot of time to find out the solution how to use datepicker in struts 1. I spend a lot of hours googling around but I did not find any useful information. I have already decided to move to struts 2 where a datepicker functionality is a very simple task. Fortunatelly I found the solution at the end.

SOLUTION:
I am using Struts 1.3.8. The Struts tag has no name attribute although the javascript needs the attribute name as the first parameter.

<html:text name="StrutsForm" property="formattedDate" size="11" maxlength="11"></html:text>
<script language="JavaScript">
new tcal ({
// form name
'formname': 'StrutsForm',
// input name
'controlname': 'formattedDate'
});
</script>