File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes List Box problem Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "List Box problem" Watch "List Box problem" New topic
Author

List Box problem

Giri Mysore
Greenhorn

Joined: May 12, 2003
Posts: 1
I have two list boxes i am moving selected data from box1 to box2. When i try to read box2 value at server side i am not getting that. But i am getting box1 values. Here is the code.
Vector travelStaffVector = TravelStaffCollection.travelStaffCollection;
for (int i = 0; i < travelStaffVector.size(); i++)
{ %>
<option VALUE="<%=((TravelStaff)travelStaffVector.elementAt(i)).getAssociateID()%>" >
<%=((TravelStaff)travelStaffVector.elementAt(i)).getFirstName() + " " + ((TravelStaff)travelStaffVector.elementAt(i)).getLastName()%>
</option>
<% } %>
</select>
</td>
<td>
<a href="javascript:moveIt( newassignmentform.fieldFrom, newassignmentform.fieldTo )">>></a>
<br>
<a href="javascript:moveIt( newassignmentform.fieldTo, newassignmentform.fieldFrom )"><<</a>
</td>
<td><p class="celltxt"><b>Selected Travel Staff:<br>
<select name="fieldTo" size="5" style="width:200;">
<option VALUE="">return javascript:moveIto( newassignmentform.fieldFrom, newassignmentform.fieldTo ) </option>
</select>

Here is javascripts
function bumpUp( box ) {
for( var i=0; i<box.options.length; i++ ) {
if( box.options[i].value == "" ) {
for( var j=i; j<box.options.length-1; j++ ) {
box.options[j].value = box.options[j+1].value;
box.options[j].text = box.options[j+1].text;
}
var ln = i;
break;
}
}
if( ln < box.options.length ) {
box.options.length -= 1;
bumpUp( box );
}
}
 
 
subject: List Box problem
 
Threads others viewed
ask for the pass value
dependent select list options
StringTokenizer error on JSP
Values not poulating in the dropdown box.
Script using array
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com