You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jeff Thorne <je...@yahoo.com> on 2005/02/12 16:10:53 UTC

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: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Struts 1.2 - problems passing form values and form name to a javascript function

Posted by Jason Long <su...@sbcglobal.net>.
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:jeff_thorne@yahoo.com] 
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: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org




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