Results 1 to 1 of 1
Thread: Getting values of an Option List
- 08-07-2007, 03:42 AM #1
Member
- Join Date
- Jul 2007
- Posts
- 9
- Rep Power
- 0
Getting values of an Option List
Hi all. I want to retrieve the value selected from the option list and i use the value, in the same jsp page, in the method down.
How do i get the this value selected? Any one to help me?
my code
<%
Statistics stat = new Statistics();
%>
<p>
Province <select name="province">
<option value ="Nairobi" selected>Nairobi</option>
<option value ="Central">Central</option>
<option value ="Central">Coast</option>
<option value ="Eastern">Eastern</option>
<option value ="North Eastern">North Eastern</option>
<option value ="Nyanza">Nyanza</option>
<option value ="Rift Valley">Rift Valley</option>
<option>Western</option>
</select>
</p>
<%
String province = OPTION.index;
ArrayList<DistrictObject> dist = stat.getDistricts(province);
for (int i=0; i<dist.size(); i++) {
%>
<p>
District <select name="district">
<option value = "<%=dist.get(i).getProvCode()%><%=dist.get(i).getD istCode()%>"> <%=dist.get(i).getDistName()%></option>
</select>
<% } %>
Similar Threads
-
Accessing boolean Values of another values in one class.
By a_iyer20 in forum Advanced JavaReplies: 4Last Post: 04-15-2008, 01:04 PM -
Menu on phone number option of a list
By Poonam in forum CLDC and MIDPReplies: 7Last Post: 01-31-2008, 01:42 PM -
the -eprof option?
By GVD in forum Advanced JavaReplies: 2Last Post: 01-10-2008, 01:48 PM -
Is there a way to remove an option from optionsCollection?
By schu777 in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 08-02-2007, 09:47 PM -
problem with XERCES Parser using Option FieldType
By oregon in forum New To JavaReplies: 1Last Post: 07-24-2007, 01:44 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks