struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hubert Rabago <hrab...@gmail.com>
Subject Re: Using javascript to access nested form items
Date Mon, 14 Mar 2005 22:59:46 GMT
or try something like:

document.projectForm["projectStobsForms[1].estStaffCost"].value

where "projectStobsForms[1].estStaffCost" matches what struts uses for
the field names in the form controls.

Hubert


On Mon, 14 Mar 2005 17:45:33 -0500, Frank W. Zammetti
<fzlists@omnytex.com> wrote:
> At least in IE:
> 
> projectForm.estStaffCost.value
> 
> ...will get the value of the textfield.  In fact, looking in the DOM
> inspector in Firefox, it is true there too.  Seems "nested forms" is a
> bit of a misnomer... seems the elements of the second form show up in
> the object tree of the first.
> 
> --
> Frank W. Zammetti
> Founder and Chief Software Architect
> Omnytex Technologies
> http://www.omnytex.com
> 
> jelything wrote:
> > I have a struts 1.1 form with a nested form.  I need to access
> > textareas with javascript, but am not hitting the right syntax.  Can
> > anyone help me out?
> >
> > The main form is 'projectForm'.
> > The nested form is 'projectStobsForms'.
> > The textfield I'm trying to read/write is 'estStaffCost'.
> >
> > I've tried:
> >
> > window.opener.document.projectForm.projectStobsForms[1].estStaffCost.value
> >
> > and
> >
> > window.opener.document.projectForm.elements[projectStobsForms[1].estStaffCost].value
> >
> > And neither works.  Any suggestions are, as always, much appreciated.
> >
> > J
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > 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
> 
>

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


Mime
View raw message