You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Steve Widmar <sw...@irf.com> on 2002/10/11 06:21:37 UTC

nested references and javascript

I've got a question about this subject that's probably obvious to experienced users.

I've searched the mail archives on the subject and haven't found any joy, so here's my puzzler:

I'm starting to use nested references in 1.0.2...
for example: <html:text property="foo.bar" />

The framework is working fine, as I've got a getFoo() on the named bean with a getBar() and it shows in the html form in the browser.

When i try to update existing javascript to match the new nest-compliant name, it dont work :-(
for example:  Number(document.forms[0].foo.bar.value);
generates the following error message:  document.forms[0].foo has no properties.

So the $.64 question:  ->  am i doing it wrong, or is it undoable?

I guess it's more of a 'javascript-users' issue, but i figgered someone here has hit this already

(Why 1.0.2? The app's been in production for a while on 1.0.2... (BTW, thanks struts-dev)).

Thanks, 
Steve




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: nested references and javascript

Posted by James Mitchell <jm...@telocity.com>.
You can use an alternate sytax.

Example:
Number(document.forms["myForm"].elements["foo.bar"].value);
  or
Number(document.forms[0].elements["foo.bar"].value);



James Mitchell
Software Engineer/Struts Evangelist
http://www.open-tools.org

> -----Original Message-----
> From: Steve Widmar [mailto:swidmar1@irf.com]
> Sent: Friday, October 11, 2002 12:22 AM
> To: struts-user@jakarta.apache.org
> Subject: nested references and javascript
> 
> 
> I've got a question about this subject that's probably obvious to 
> experienced users.
> 
> I've searched the mail archives on the subject and haven't found 
> any joy, so here's my puzzler:
> 
> I'm starting to use nested references in 1.0.2...
> for example: <html:text property="foo.bar" />
> 
> The framework is working fine, as I've got a getFoo() on the 
> named bean with a getBar() and it shows in the html form in the browser.
> 
> When i try to update existing javascript to match the new 
> nest-compliant name, it dont work :-(
> for example:  Number(document.forms[0].foo.bar.value);
> generates the following error message:  document.forms[0].foo has 
> no properties.
> 
> So the $.64 question:  ->  am i doing it wrong, or is it undoable?
> 
> I guess it's more of a 'javascript-users' issue, but i figgered 
> someone here has hit this already
> 
> (Why 1.0.2? The app's been in production for a while on 1.0.2... 
> (BTW, thanks struts-dev)).
> 
> Thanks, 
> Steve
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   
> <ma...@jakarta.apache.org>
> For additional commands, e-mail: 
> <ma...@jakarta.apache.org>
> 
> 

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>