One solution:

Set the <name> property of <html:text>.

Write a JavaScript function that sets the value of an <html:hidden> field
with the date string from calendar1Callback2, then calls submit.  The
associated ActionForm's (specified in struts-config) property setTextName
will be set with the date string.  Set the <input> property for ActiveAlarm
in struts-config that sends the form data back to the same JSP. The text
field should now display the date string.  If you need (and probably will)
to direct a submit to another ActionMapping, just put the control(s) in
another <html:form action="/AnotherClass"> and configure accordingly in
struts-config's <action-mappings>.

Leave the reset() method in your ActionForm bean empty.

See:
http://jakarta.apache.org/struts/api/org/apache/struts/taglib/html/package-s
ummary.html#package_description

Mark

-----Original Message-----
From: Vijayabhaskar Reddy Patil [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, February 06, 2003 12:24 PM

I am kinda new to struts.Here is the problem:
I have a calendar(java script) control in the form: when I 
Click on the control, I want to populate a text field
With the date clicked. Please let me know which tag 
I can use to populate that text field.

The Code given under is not working:

<html:form action="/ActiveAlarm">
     <html:text property="fromId" size="14" />
      <script> 
       calendar2 = new dynCalendar('calendar2', 'calendar1Callback2');
       function calendar1Callback2(date, month, year)
        {
             document.forms['activeAlarm'].fromId.value = date + '/' + month
+ '/' + year;
        }
      </script>
</html:form>

The function calendarCallback is the call back function I get from the
control.

Thanks
Vijay



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to