Solved

<SELECT><OPTION VALUE=array[]>

Posted on 2002-03-12
6
165 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Never store passwords in plain text or just their hash: it seems a no-brainier, but there are still plenty of people doing that. I present the why and how on this subject, offering my own real life solution that you can implement right away, bringin…
A safe way to clean winsxs folder from your windows server 2008 R2 editions
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now