Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi, I have the following code, to p

Status
Not open for further replies.

deddleston

Programmer
Oct 4, 2002
43
0
0
GB
Hi, I have the following code, to product a pull down menu

<%
StringTokenizer st = new StringTokenizer(dao.getAllSolutions(), &quot;|&quot;);
out.println(&quot;<select name=\&quot;menu1\&quot; onChange=\&quot;MM_jumpMenu2('self',this,0)\&quot;>&quot;);
String nextVal = &quot;&quot;;
int counter = st.countTokens();
if (counter == 1) {
nextVal = st.nextToken();
out.println(&quot;<option selected value='metadata_search_facility.jsp?solName=&quot;+solName+&quot;&component_name=&quot;+nextVal+&quot;'>&quot;+nextVal+&quot;</option>&quot;);
} else {

if (component_name == null) {
out.println(&quot;<option selected>All IM Solutions2</option>&quot;);
}

while (st.hasMoreTokens()) {
nextVal = st.nextToken().trim();
out.println(&quot;<option &quot;);
if ((component_name != null) && (component_name.trim().equals(nextVal))) {
out.println(&quot;selected &quot;);
}
out.println(&quot;value='metadata_search_facility.jsp?solName=&quot;+solName+&quot;&component_name=&quot;+nextVal+&quot;'>&quot;+nextVal+&quot;</option>&quot;);
}
}
if ((counter == 1) && (component_name == null)) {
//Only 1 exists
response.sendRedirect(&quot;metadata_search_facility.jsp?solName=&quot;+ solName +&quot;&component_name=&quot;+nextVal);
}
%>

However this doesn't always allow &quot;all IM solutions&quot; to be a choosable option all the time. It will start with that option, but if you choose another (dynamic) the &quot;all IM solutions&quot; option disapears. I need to make it always be there. M$ arn't the only option!
 
The only thing that can explain that to my mind is that you do something into the &quot;MM_jumpMenu&quot; function. Water is not bad as long as it stays out human body ;-)
 
I sorted it....

didn't have to change MM_JumpMenu function, just wrote the before the nextValue string and changed the option selected around... bit fiddly! M$ arn't the only option!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top