struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrian_R...@adp.com
Subject RE: How can I refer a control in javascript which hava a "." in i ts name
Date Thu, 18 Aug 2005 22:43:16 GMT
Try this: document.all['myForm'].value

__________________________________________________

Senior Programmer Analyst, Tax Distributed Systems Development

Tax & Compliance Development, ADP IT

Phone: (909) 592-6411 Ext. 3863

e-mail: adrian_rios@adp.com



-----Original Message-----
From: Jeff Beal [mailto:jbbeal@gmail.com] 
Sent: Thursday, August 18, 2005 1:26 PM
To: Struts Users Mailing List
Subject: 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
<BHansard@powersystems.rockwell.com> wrote:
>  
> 
>  <html:text name="myForm"
>  property="myobject.subobject" styleId="subobject" .../>
>  
>  then get the field by using
>  
>  document.getElementById("subobject");
>  
>  
>  Tony Smith <quickcur@yahoo.com>
>  
>  
>    
>  
>  
>  
>  
> Tony Smith <quickcur@yahoo.com>  
> 
> 08/18/2005 01:07 PM  
> 
> Please respond to
>  "Struts Users Mailing List" <user@struts.apache.org>        
> 
>  
> To
>  Struts Users Mailing List <user@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

-----------------------------------------
This message and any attachments are intended only for the use of the
addressee and may contain information that is privileged and confidential.
If the reader of the message is not the intended recipient or an authorized
representative of the intended recipient, you are hereby notified that any
dissemination of this communication is strictly prohibited. If you have
received this communication in error, notify the sender immediately by
return email and delete the message and any attachments from your system.



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


Mime
View raw message