Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Struts
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
Tim Cooke
Ron McLeod
paul wheaton
Jeanne Boyarsky
Sheriffs:
Paul Clapham
Devaka Cooray
Saloon Keepers:
Tim Holloway
Roland Mueller
Himai Minh
Bartenders:
Forum:
Struts
Problem with dropdown list
Deepak Sahu
Greenhorn
Posts: 23
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi All,
I have a code for a dropdown list of 1-31.
<html:select styleId="fullTimingDay" property="fullTimingDay" size="1" >
<html:option value="1">01</html:option>
<html:option value="2">02</html:option>
<html:option value="3">03</html:option>
<html:option value="4">04</html:option>
<html:option value="5">05</html:option>
<html:option value="6">06</html:option>
<html:option value="7">07</html:option>
<html:option value="8">08</html:option>
<html:option value="9">09</html:option>
<html:option value="10">10</html:option>
<html:option value="11">11</html:option>
<html:option value="12">12</html:option>
<html:option value="13">13</html:option>
<html:option value="14">14</html:option>
<html:option value="15">15</html:option>
<html:option value="16">16</html:option>
<html:option value="17">17</html:option>
<html:option value="18">18</html:option>
<html:option value="19">19</html:option>
<html:option value="20">20</html:option>
<html:option value="21">21</html:option>
<html:option value="22">22</html:option>
<html:option value="23">23</html:option>
<html:option value="24">24</html:option>
<html:option value="25">25</html:option>
<html:option value="26">26</html:option>
<html:option value="27">27</html:option>
<html:option value="28">28</html:option>
<html:option value="29">29</html:option>
<html:option value="30">30</html:option>
<html:option value="31">31</html:option>
</html:select>
Instead of writing 31 times <html:select> </html:select>,please anyone provide solution to achieve this in a scalable way so that by writing less no of code we can achieve this.
Aniket S. Kulkarni
Ranch Hand
Posts: 87
I like...
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Try this:
<html:select styleId="fullTimingDay" property="fullTimingDay" size="1" >
<% for(int i=1;i<32;i++)
{
%>
<option value="<%=i%>"><%=i%> </option>
<% }
%>
</html:select>
I hope this will help you.
Aniket Kulkarni
Oracle Certified Professional, Java SE 6 Programmer.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Trees in Java
Magic Square water retention
Problem moving columns and rows in 2D array.
Help, lunarcal.js
Birthday Calendar
More...