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 Beal <jb...@gmail.com> on 2005/08/18 22:26:10 UTC
Re: How can I refer a control in javascript which hava a "." in its name
You also have the option of doing document.form[0]['myobject.subobject'].
On 8/18/05, BHansard@powersystems.rockwell.com
<BH...@powersystems.rockwell.com> wrote:
>
>
> <html:text name="myForm"
> property="myobject.subobject" styleId="subobject" .../>
>
> then get the field by using
>
> document.getElementById("subobject");
>
>
> Tony Smith <qu...@yahoo.com>
>
>
>
>
>
>
>
> Tony Smith <qu...@yahoo.com>
>
> 08/18/2005 01:07 PM
>
> Please respond to
> "Struts Users Mailing List" <us...@struts.apache.org>
>
>
> To
> Struts Users Mailing List <us...@struts.apache.org>
>
>
> cc
>
>
>
> Subject
> How can I refer a control in javascript which hava a "." in its name
>
>
> Hi everyone:
>
> Here is my jsp:
>
> <html:form>
> ...
> <html:select ... onChange="change(this)">
> ...
>
> </html:select>
>
> <html:text name="myForm"
> property="myobject.subobject" .../>
>
>
> </html:form>
>
> If user change the selection in the "select", I would
> like to change the content of the "text". Thus, I
> write my change() function in javascript:
>
> <script language="javascript">
>
> function change(select){
>
> document.form[0].myobject.subobject =
> select.options[select.selectedIndex];
> }
>
> But looks like this does not work. The problem is the
> name of the "text". In the html it is
> "myobject.subobject". But seems that javascript does
> not take that....
>
> How can I refer the "text" in javascript?
>
> Thanks,
>
>
>
>
>
> ____________________________________________________
> Start your day with Yahoo! - make it your home page
> http://www.yahoo.com/r/hs
>
>
> ---------------------------------------------------------------------
> 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