How do I remove empty space combo box
843838Jan 3 2006 — edited Jan 4 2006My promblem is that I have empty space between selected option and the other option Below are code i used to build this combo box .This combo box display list of possible user of the system and selected option show to the currrent user of the system. Code are[
code]
<% sql_query = "SELECT em_num, em_name, dfu_usr_id "+
" FROM dfusrf, emmast "+
" WHERE dfu_emp_id = em_num "+
" ORDER BY em_name ";
try{
rset = db.execSQL(sql_query);
while ( rset.next()){
String em_num2 = rset.getString("em_num");
String em_nme2 = rset.getString("em_name");
%>
<option value="<%= em_num2 %>">
<% if ( em_num2.equals(em_num) ){%>
<option value="<%= em_num2 %>"selected>
<%= em_nme2 %></option>
<%} // end if
%><%= em_nme2 %></option>
<%} // end while
} // end try
catch ( Exception e )
{
System.err.println("Error in query - emmast2 - transaction_main.jsp " e.getMessage() " sql " + sql_query);
}
finally
{
if ( rset != null ) rset.close();
}
%>
</select>
[/code
]