struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "charles arehart" <careh...@systemanage.com>
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).

/charlie

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


Hi,

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();
cal0.setReturnFunction('showDate0');
cal0.offsetX=2;
function showDate0(y,m,d)
{document.forms[0].elements['registrationDate'].value = y + "-" + m + "-" +
d;}
</script>
<html:text property="registrationDate" size="10" maxlength="10">

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

Andrej

BTW, pretty nice JS calendar at
http://www.mattkruse.com/javascript/calendarpopup/

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


Hello,

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
closes...

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,
paul




__________________________________________________
Do You Yahoo!?
Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1

--
To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message