<SELECT><OPTION VALUE=array[]>

I know this is more html than jsp, but I'm executing it in a jsp.  Can I assign an array to the value of an option?

Like this:

<SELECT><OPTION VALUE=array[]>    


200 pts.--a ridiculously gernerous question.
RUSTYAsked:
Who is Participating?
 
kotanConnect With a Mentor Commented:
You can't assign an array to the value of option.
What you can do is extract all the value and put a delimeter like comma(,) or pipe(|) in between.

Here is the sample code:

<option value="
<% for (int i = 0; i < array.length; i++) { %>
  <%=array[i] + "|"%>  
<% } %>
"></option>
0
 
cheekycjCommented:
can you maybe output the array as a comma delimted list.. and put that as the value?

CJ
0
 
knightEknightCommented:

like this?

  <OPTION VALUE='<%=array[0]%>'><%=array[0]%></option>
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
cheekycjCommented:
kotan: Isn't that what I suggested in my first comment?
0
 
RUSTYAuthor Commented:
cheekyci give hint, kotan give answer.
0
 
cheekycjCommented:
Kotan.. gave an example of how to do my approach.

Anyhow, as long you got your desired answer.

CJ
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.