Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Dynamic select list with JSP

 
Rosa Thimerman
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, everybody,
I need to build dynamic select list within a table.
the size of this selection will depend on userlogin permission.
I need be able to have my selection box size same as my table.
option value should come dynamicaly as well as option name.
Please, help
 
Ghazanfar Qureshi
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<table>
<tr>
<td><form method="post" name="" action="">
<select name="mySelect" STYLE="width:80px">
<%
//suppose u ve an array of permission and array of
// value or numeric id matching at respective index

String perm[] =new String[10];
int permid[] =new permid[10];
// some how u fill both the arrays from database or hard-coded
//it depends on you
for (int i=0; i< perm.length; i++){
%>
<option value="<%=permid[i] %>"><%= perm[i] %></option>
<%
}
%>
</select></form>
</td>
</tr>
</table>

for fixed width i used the style sheet tag it wont run on olser browser
regards
Ghazanfar Qureshi
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic