Solved

<SELECT><OPTION VALUE=array[]>

Posted on 2002-03-12
6
168 Views
Last Modified: 2010-05-18
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.
0
Comment
Question by:RUSTY
6 Comments
 
LVL 19

Expert Comment

by:cheekycj
ID: 6857092
can you maybe output the array as a comma delimted list.. and put that as the value?

CJ
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 6857097

like this?

  <OPTION VALUE='<%=array[0]%>'><%=array[0]%></option>
0
 
LVL 6

Accepted Solution

by:
kotan earned 200 total points
ID: 6859115
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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 19

Expert Comment

by:cheekycj
ID: 6861147
kotan: Isn't that what I suggested in my first comment?
0
 

Author Comment

by:RUSTY
ID: 6861169
cheekyci give hint, kotan give answer.
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 6861185
Kotan.. gave an example of how to do my approach.

Anyhow, as long you got your desired answer.

CJ
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial shows how to create a greeting card by combining two image layers and a text layer on a PC using a free image editing app.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question