struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "charles arehart" <>
Subject RE: <html:form> and javascript popup calendar
Date Tue, 20 Nov 2001 22:15:13 GMT
Besides the recommendation below to use that particular code, the example
also points out that another solution (with whatever popup code you use) is
to simply refer to the form by relative reference rather than the form's
NAME, as it seems you wanted to do. For example, instead of using
document.<formname>.<whatever>, use document.forms[0].<whatever>. Pay
attention to the number used as the index: if you have more than one form on
the page, using forms[0] indicates that you're referring to the first form
on the page (with the count starting at 0).


-----Original Message-----
From: Sobkowski, Andrej []
Sent: Tuesday, November 20, 2001 4:17 PM
To: 'Struts Users Mailing List'
Subject: RE: <html:form> and javascript popup calendar


you can try something like:

<!-- This is JS stuff - see link below if interested -->
<script language='JavaScript' src='/javascript/AnchorPosition.js'></script>
<script language='JavaScript' src='/javascript/PopupWindow.js'></script>
<script language='JavaScript' src='/javascript/CalendarPopup.js'></script>
<script language='JavaScript'>var cal0 = new CalendarPopup();
function showDate0(y,m,d)
{document.forms[0].elements['registrationDate'].value = y + "-" + m + "-" +
<html:text property="registrationDate" size="10" maxlength="10">

HTH.. I've used a tag to generate the above, but it should work fine...


BTW, pretty nice JS calendar at

-----Original Message-----
From: Paul []
Sent: Tuesday, November 20, 2001 4:02 PM
To: Struts Users Mailing List
Subject: <html:form> and javascript popup calendar


Is there a way to include a popup calendar within my

<html:form action="/Action_Page" >

to populate a <html:text> field??

normally, the JS would open a popup, you would select
the date, the text field would populate and the window

The normal popup JS calendar is dependent on the form
name, but i haven't had any luck getting the syntax
right w/ struts.

thank you in advance,

Do You Yahoo!?
Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message