Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within JSP
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
JSP
Store arrayList into DropDownList
Shamsa Al Neyadi
Greenhorn
Posts: 2
posted 11 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hello ,
Guys I'm trying to store the ArrayList items into dropDownList , it created fields for them but they are empty.
this my code :
<form method="POST" action="myCapture.jsp"> Enter your name : <input type="text" name="myName"/> <br/> <% Iterator it = a.iterator(); %> Select Port Name: <select name="myComboBox"> <% while (it.hasNext()) {%> <option><% it.next();%></option> <%}%> </select> <br/>
i tried for loop also , i faced the same problem.
help me please.
kind regards
zohaib khan
Greenhorn
Posts: 22
posted 11 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi Shamsa Al Neyadi,
You can use FOR loop to iterate over array list
for (int i = 0; i < list.size(); i++) { System.out.println(list.get(i)); }
- Thanks
Zohaib.
Shamsa Al Neyadi
Greenhorn
Posts: 2
posted 11 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
i used it , but does not work !
BTW , i don't want to print the values of the arraylist , i want to store the arraylist items into dropdownlist.
Dhaval J. Patel
Ranch Hand
Posts: 90
I like...
posted 11 years ago
1
Number of slices to send:
Optional 'thank-you' note:
Send
First off you shouldnt be using scriptlets in
jsp
, makes it messy really.
Second, you are missing the value attribute in your option tag.
Third,
you should
post more information on what happens when you run the code.
Bear Bibeault
Sheriff
Posts: 67746
173
I like...
posted 11 years ago
1
Number of slices to send:
Optional 'thank-you' note:
Send
Please read
this JspFaq entry
.
[
Asking smart questions
] [
About Bear
] [
Books by Bear
]
With a little knowledge, a
cast iron skillet
is non-stick and lasts a lifetime.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Dout on EL question in Enthuware test Kit?
Java script is not populated on webpage.
How to get default value to my dropdown list
dynamic drop down boxes
How to use for loop inside of dropdownlist at jsp?
More...