Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

<SELECT><OPTION VALUE=array[]>

Posted on 2002-03-12
6
Medium Priority
?
175 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 800 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
Ranking ecommerce websites is a vital process. You need to have a strong SEO (Search Engine Optimization) strategy. If you don’t have one, you are losing out on brand impressions, clicks and sales. Check this guide on how to improve website traffic …
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

824 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