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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dear darlings, I'm just learning 1

Status
Not open for further replies.

rubia

Technical User
Jan 9, 2001
3
NL
dear darlings,

I'm just learning and working in an Internet advertisement agency and I can't figure out how to make a dropdown menu, where everything is shown where I ask.
It all looks like this:



<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;>
<CFQUERY datasource=&quot;kortingen&quot; name=&quot;Adverteerders&quot;>
SELECT clientID,clientname
FROM Adverteerders
ORDER BY clientID;
</cfquery>

<html>
<script language=&quot;JavaScript&quot;>
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+&quot;.location='&quot;+selObj.options[selObj.selectedIndex].value+&quot;'&quot;);
if (restore) selObj.selectedIndex=0;
}

function MM_findObj(n, d) { //v3.0
var p,i,x; if(!d) d=document; if((p=n.indexOf(&quot;?&quot;))>0&amp;&amp;parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&amp;&amp;d.all) x=d.all[n]; for (i=0;!x&amp;&amp;i<d.forms.length;i++) x=d.forms[n];
for(i=0;!x&amp;&amp;d.layers&amp;&amp;i<d.layers.length;i++) x=MM_findObj(n,d.layers.document); return x;
}

function MM_jumpMenuGo(selName,targ,restore){ //v3.0
var selObj = MM_findObj(selName); if (selObj) MM_jumpMenu(targ,selObj,restore);
}
//-->
</script>
<head>
<title>Welkom</title>
<style type=&quot;text/css&quot;>
<!--
a:hover { color: #FFFFFF; text-decoration: underline}
a { color: #FFFFFF; text-decoration: none}
-->
</style>
<link rel=&quot;stylesheet&quot; href=&quot;Sheets/tekstsettings.css&quot;>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
</head>

<body bgcolor=&quot;#E8E8E8&quot; text=&quot;000066&quot; link=&quot;000066&quot; vlink=&quot;000066&quot; alink=&quot;000066&quot; topmargin=&quot;0&quot; background=&quot;plaatjes/achterko.jpg&quot;>
<span class=&quot;koptekst&quot;></span>
<center>
<table width=&quot;552&quot; border=&quot;0&quot; align=&quot;right&quot;>
<tr>
<td background=&quot;plaatjes/tablebeeld07.jpg&quot;>
<div align=&quot;left&quot;><span class=&quot;koptekst&quot;> <font color=&quot;#CCCCCC&quot; size=&quot;3&quot; face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;>content
manager van Kortingen.nl </font></span> </div>
</td>
</tr>
<tr bgcolor=&quot;#FFCC00&quot;>
<td height=&quot;2&quot;></td>
</tr>
<tr>
<td valign=&quot;center&quot; width=&quot;240&quot;> <br>
<br>
<form name=&quot;form1&quot;>
<cfoutput query=&quot;Adverteerders&quot;>
<select name=&quot;menu1&quot; onChange=&quot;MM_jumpMenu('parent',this,0)&quot;>
<option value=&quot;../test/1/&quot; selected>#clientID# #clientname#</option>
<option value=&quot;../test/2/&quot; selected>#clientID# #clientname#</option>
<option value=&quot;../test/3/&quot; selected>#clientID# #clientname#</option>
<option value=&quot;../test/4/&quot; selected>#clientID# #clientname#</option>
<option value=&quot;../test/5/&quot; selected>#clientID# #clientname#</option>
<option value=&quot;../test/6/&quot; selected>#clientID# #clientname#</option>
<option value=&quot;../test/7/&quot; selected>#clientID# #clientname#</option>
<option value=&quot;../test/8/&quot; selected>#clientID# #clientname#</option>
<option value=&quot;../test/9/&quot; selected>#clientID# #clientname#</option>
<option value=&quot;../test/10/&quot; selected>#clientID# #clientname#</option>
</select>
</cfoutput>
</form>
</td>
<tr align=&quot;right&quot; valign=&quot;bottom&quot;>
<td width=&quot;240&quot; height=&quot;38&quot;>
<div class=&quot;plattetekst&quot;>
<table width=&quot;300&quot; border=&quot;0&quot;>
<tr>
<td bgcolor=&quot;#000099&quot;>
<div align=&quot;left&quot;><a href=&quot;hoofdbanner0x.html&quot;><font color=&quot;#CCCCCC&quot; size=&quot;1&quot; face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;>Terug</font></a></div>
</td>
<td bgcolor=&quot;#000099&quot;><a href=&quot;javascript:self.close()&quot;><font color=&quot;#CCCCCC&quot; size=&quot;1&quot; face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;>Afsluiten</font></a>
</td>
</tr>
</table>
<div align=&quot;right&quot;></div>
</div>
</td>
</tr>
</table>
</center>
</body>
</html>

The problem is, my senior chief wants a dropdown menu where everything, from 1 -10 is dropped down as the output of the query. Until now I only got one ID and name.

It is a bit tricky(he says). It is a good person and I don't want to disappoint him. Our mutual boss is in a hurry. I do want to help him.
Yes, I know, the above code is for a jump menu.

sincerilly yours,
Rubia
 
Hi,

in your cfoutput you shouldn't include all the data you want to be output. One is enough, because if there is more than one record in your database it will be automatically included in the output. It should be this:

<form name=&quot;form1&quot;>
<select name=&quot;menu1&quot; onChange=&quot;MM_jumpMenu('parent',this,0)&quot;>
<cfoutput query=&quot;Adverteerders&quot;>
<option value=&quot;../test/1/&quot;>#clientID# #clientname#</option>
</cfoutput>
</select>
</form>

Regards Wouter


Wouter
zure_zult@hotmail.com
To me, boxing is like a ballet, except there's no music, no choreography, and the dancers hit each other.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top