Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

jsp javascript  RSS feed

 
Rishi Chopra
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,

my code that is calling a javascript function addRow but i am not able to create a drop down list in that new row i am getting a list in a string array

---------------------
'<%for(int i=0;i<batchList.length;i++){%><select name=btch><options name=<%=batchList[i]%><%=batchList[i]%></options><%}%></select>',
----------------------
this line in above code is troubling me since two-three days if any body can plz let me know wat i am doing worng...i know jsp elements get resolved during compile time so why still this line is not able to work wat i want

Rgds
Rishi Chopra
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66208
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not a Servlets question so moved to the JSP forum.
 
pankaj patil
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<%
for(int i=0;i<batchList.length;i++){%><select name=btch><options name=<%=batchList[i]%><%=batchList[i]%></options><%}%></select>',
 
Babar Qadri
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try this

<select name=btch>
<%for(int i=0;i<batchList.length;i++)
{%>
<options name=<%=batchList[i]%>><%=batchList[i]%></options>
<%}%>
</select>
[ December 08, 2005: Message edited by: Babar Qadri ]
 
pankaj patil
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
change your code from
this
<%
for(int i=0;i<batchList.length;i++)
{%>
<select name=btch>
<options name=<%=batchList[i]%><%=batchList[i]%></options>
<%}%></select>',


to

<select name=btch>
<%
for(int i=0;i<batchList.length;i++)
{%>
<options name=<%=batchList[i]%><%=batchList[i]%></options>
<%}%></select>
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!