I use the following: <input type="image" src="images/calendar.gif" onclick="popUpCalendar(this, this.form.elements['quoteValue.dateNeeded'], 'mm/dd/yyyy');return false;"/> <html:text name="quoteForm" property="quoteValue.dateNeeded" styleClass="input2" onkeypress="return noenter();"/>
By passing this you do not need the get by id. This also solves having forms with the same name. I dealt with this by using the name attribute in the html:form tag in struts 1.1, but switched to this when I upgraded to struts 1.2 since name is no longer valid in html:form Thank you for your time, Jason Long CEO and Chief Software Engineer BS Physics, MS Chemical Engineerring http://www.supernovasoftware.com -----Original Message----- From: Jeff Thorne [mailto:[EMAIL PROTECTED] Sent: Saturday, February 12, 2005 9:11 AM To: Struts Users Mailing List Subject: Struts 1.2 - problems passing form values and form name to a javascript function Has anyone successfully integrated a javascript date picker into a struts 1.2 app. I am having troubles getting many date pickers to work because of not being able to name a form in struts 1.2. I have tried passing the styleID with no success: -------------------jsp page segment----------------------- <script> function passToDatePicker () { document.getElementById("form1"); } </script> <html:form action="postFrom.do" styleId="form1"> -------------------jsp page segment----------------------- Can anyone recommend a javascript calendar that works with 1.2 or suggest a more efficient way to pass a form name in 1.2. I am a struts newbie so forgive me if I am overlooking something simple. Thanks for the help, Jeff --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]