You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Sathish Babu K R <kr...@yahoo.com> on 2004/05/11 09:27:50 UTC

from sathish:regarding javascript arrays

hi all

i have a reg in my module that i should pass array
from jsp to javascript function.how to do that?thanx
in advance

sathish


	
		
__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs  
http://hotjobs.sweepstakes.yahoo.com/careermakeover 

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


Re: from sathish:regarding javascript arrays

Posted by Bill Siggelkow <bi...@bellsouth.net>.
Sathish,

What you probably will want to do is use the Struts logic:iterate and 
bean:write tags to generate the array *within* the JavaScript function.

   <script language="JavaScript">
      // Create the array for the first set of options
      fooArray = new Array();
      <logic:iterate id="fooValue" indexId="ctr"
                   name="MyForm"  property="fooList">
           fooArray[<bean:write name="ctr"/>] =
              new Option("<bean:write name='fooValue'/>",
                         "<bean:write name='fooValue'/>",
                         false, false);
      </logic:iterate>
...



Sathish Babu K R wrote:
> hi all
> 
> i have a reg in my module that i should pass array
> from jsp to javascript function.how to do that?thanx
> in advance
> 
> sathish
> 
> 
> 	
> 		
> __________________________________
> Do you Yahoo!?
> Win a $20,000 Career Makeover at Yahoo! HotJobs  
> http://hotjobs.sweepstakes.yahoo.com/careermakeover 


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