http://javascript.internet.com/forms/auto-drop-down.html

Have fun
JM



> -----Original Message-----
> From: sanjeev_dutt [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 15, 2002 8:32 AM
> To: Struts Users Mailing List
> Subject: Passing JavaScript variable to a Java Scriptlet on a JSP page
> 
> 
> Hi,
> 
> I have this piece of code on my JSP:
> 
> <Script language = "javascript"> 
>  function fnGetStates()
>  {
> country = document.searchAcctForm.cboAcctAddrCountry.value;  
> alert(country);                                                   
>          
> document.write('<% Hashtable states = new Hashtable(); %>'); 
> document.write('<% states = Combo.getStates(country);%>');
> document.write('<% Enumeration state = states.keys(); %>');
> document.write('<% while (state.hasMoreElements()) { %>');
> document.write('<% String statecode = (String)state.nextElement(); %>');
> document.write('<% String sts = (String)states.get(statecode); 
> %>');                                                         
> document.write('<html:option value="<%= statecode %>"><%= sts 
> %></html:option>');
> document.write('<%  } %>'); 
> }
> </Script>
> 
> 
> The problem is that "alert" is able to show the value of country. 
> But within the document.write, It  is not able to get the value 
> of "country". It throws the following error :
> 
> ~:\citione\web\WEB-INF\_tmp_war_myserver_myserver_web\jsp_servlet\
> _jsp\_search\__searchacct.java:801: cannot resolve symbol
> probably occurred due to an error in /jsp/search/searchacct.jsp line 197:
> document.write('<% states = Combo.getStates(country);%>');
> Could some one help ?
> Thanks
> Sanjeev
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: 
> <mailto:[EMAIL PROTECTED]>
> 
> 

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to