• 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
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

JSP select box - servlet

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What could be the reason the selected value does not get transmitted to the servlet in the following code:

<select name="choice" size="15">
<option value="choose" selected>Please select #</option>

<%String batchNum = "";
AbstractList beans = (AbstractList)request.getAttribute ("mylist");
Iterator iterator = beans.iterator();
int i = 1;
while (iterator.hasNext()){
GetDataBean bean = (GetDataBean) iterator.next();
batchNum = bean.getBatchNum();
i++;
%>
<option value="<%= batchNum %>"><%= batchNum %></option>
<% } %>
</select>

Your responce is greately appreciated. Thanks. Mike.
 
Sheriff
Posts: 67752
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First step: have you checked the formatting of the HTML that is sent to the browser?
[ July 13, 2004: Message edited by: Bear Bibeault ]
 
Michael Waserman
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Bear,
I submit the form using the button as follows:

<script LANGUAGE="JavaScript">
function sendApprove(aForm){
aForm.action = "/servlet/BatchApprServlet3";
aForm.submit();
</script>

<input type="button" name="approve" value = " Approve " onKlick="sendApprove(this.form)">

Thanks. Mike.
 
I didn't do it. You can't prove it. Nobody saw me. The sheep are lying! This tiny ad is my witness!
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic