ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 21st, 2005, 12:50 AM
dancegruv dancegruv is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 1 dancegruv User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy CFM / Javascript help

Hello all. I am a complete newbie both at cfm and javascript. I am more in the design area, but i am taking a shot at this and liking what i see and taking more interest.

Here is my bug...

Tryng to do a query in cfm that will pull lets say... 18 hotels countries and list them in two rows of 9 each (9countries per row)... Hoever if there are more than 1 hotel then a javacript layer woudl show when you mouseover, showing the hotels situated in that country. if only one hotel in a country then it will simply list the country. somwhere along these lines my Javascriptiing is going bad where it lists all the countries+1 see my code below:

<cfparam name="ATTRIBUTES.destId">
<cfquery name="getDestHotelList" datasource="#APPLICATION.db_datasource#" username="#APPLICATION.db_username#" password="#APPLICATION.db_password#">
SELECT hotelId, hotelCode, hotelName, countrycode
FROM hotels
WHERE hotelDestId = #ATTRIBUTES.destId#
AND hotelPublished = 'Y'
ORDER BY countrycode DESC limit 40
</cfquery>
<cfparam name="CALLER.menuNo" default="1">
<cfset i = 1>

<table width="100%" border="0" cellspacing="0" cellpadding="1">
<tr>
<td width="50%" align="left" valign="top" bgcolor="red">
<cfloop index="i" from="1" to="9" >
<!--- Check for list --->
<cfif i LT getDestHotelList.recordCount AND getDestHotelList.countrycode[i+1] EQ getDestHotelList.countrycode[i]>
<cfoutput><a href="##" name="popLink#CALLER.menuNo#" id="popLink#CALLER.menuNo#" onMouseOver="MM_showMenu(window.mm_menu#CALLER.menuNo#,100,0,null,'popLink#CALLER.menuNo#')" onMouseOut="MM_startTimeout();">#getDestHotelList.countrycode[i]#
</cfoutput></a><br>


<cfoutput>
<script>
function prepairMenu#CALLER.menuNo#(){
window.mm_menu#CALLER.menuNo# = new Menu("root",110,15,"Verdana, Arial, Helvetica, sans-serif",9,"##000000","##000000","##EEEEEE","##FF9900","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);
mm_menu#CALLER.menuNo#.addMenuItem("#JSStringFormat(getDestHotelList.hotelName[i])#","location='hotels/#JSStringFormat(getDestHotelList.hotelCode[i])#_home.cfm'");
<cfloop condition="i LT getDestHotelList.recordCount AND getDestHotelList.countrycode[i+1] EQ getDestHotelList.countrycode[i]">
<cfset i = i + 1>
mm_menu#CALLER.menuNo#.addMenuItem("#JSStringFormat(getDestHotelList.hotelName[i])#","location='hotels/#JSStringFormat(getDestHotelList.hotelCode[i])#_home.cfm'");
</cfloop>
mm_menu#CALLER.menuNo#.hideOnMouseOut=true;
mm_menu#CALLER.menuNo#.bgColor='##555555';
mm_menu#CALLER.menuNo#.menuBorder=1;
mm_menu#CALLER.menuNo#.menuLiteBgColor='##FFFFFF';
mm_menu#CALLER.menuNo#.menuBorderBgColor='##FFFFFF';
return true;
}
</script>
</cfoutput>

<cfset CALLER.menuNo = CALLER.menuNo + 1>

<!--- Skip over this group --->
<!---<cfloop condition="i LT getDestHotelList.recordCount AND getDestHotelList.hotelAddress[i+1] EQ getDestHotelList.hotelAddress[i]"><cfset i = i + 1></cfloop>--->
<cfelse>
<a href="hotels/<cfoutput>#getDestHotelList.hotelCode[i]#_home.cfm"><cfif Len(getDestHotelList.countrycode[i])>
</cfif><cfif Len(getDestHotelList.countrycode[i])>
</cfif><cfif getDestHotelList.countrycode[i] NEQ "US">
#getDestHotelList.countrycode[i]#
</cfif></cfoutput></a><br>
</cfif>
<font color="#770000">
<cfset i = i + 1>
</font>
</cfloop></td>
<td width="50%" bgcolor="black"><cfloop index="i" from="10" to="20" >
<!--- Check for list --->
<cfif i LT getDestHotelList.recordCount AND getDestHotelList.countrycode[i] EQ getDestHotelList.countrycode[i]>
<cfoutput><a href="##" name="popLink#CALLER.menuNo#" id="popLink#CALLER.menuNo#" onMouseOver="MM_showMenu(window.mm_menu#CALLER.menuNo#,100,0,null,'popLink#CALLER.menuNo#')" onMouseOut="MM_startTimeout();">#getDestHotelList.countrycode[i]#
</cfoutput></a><br>


<cfoutput>
<script>
function prepairMenu#CALLER.menuNo#(){
window.mm_menu#CALLER.menuNo# = new Menu("root",110,15,"Verdana, Arial, Helvetica, sans-serif",9,"##000000","##000000","##EEEEEE","##FF9900","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);
mm_menu#CALLER.menuNo#.addMenuItem("#JSStringFormat(getDestHotelList.hotelName[i])#","location='hotels/#JSStringFormat(getDestHotelList.hotelCode[i])#_home.cfm'");
<cfloop condition="i LT getDestHotelList.recordCount AND getDestHotelList.countrycode[i+1] EQ getDestHotelList.countrycode[i]">
<cfset i = i + 1>
mm_menu#CALLER.menuNo#.addMenuItem("#JSStringFormat(getDestHotelList.hotelName[i])#","location='hotels/#JSStringFormat(getDestHotelList.hotelCode[i])#_home.cfm'");
</cfloop>
mm_menu#CALLER.menuNo#.hideOnMouseOut=true;
mm_menu#CALLER.menuNo#.bgColor='##555555';
mm_menu#CALLER.menuNo#.menuBorder=1;
mm_menu#CALLER.menuNo#.menuLiteBgColor='##FFFFFF';
mm_menu#CALLER.menuNo#.menuBorderBgColor='##FFFFFF';
return true;
}
</script>
</cfoutput>

<cfset CALLER.menuNo = CALLER.menuNo + 1>

<!--- Skip over this group --->
<!---<cfloop condition="i LT getDestHotelList.recordCount AND getDestHotelList.hotelAddress[i+1] EQ getDestHotelList.hotelAddress[i]"><cfset i = i + 1></cfloop>--->
<cfelse>
<a href="hotels/<cfoutput>#getDestHotelList.hotelCode[i]#_home.cfm"><cfif Len(getDestHotelList.countrycode[i])>
</cfif><cfif Len(getDestHotelList.countrycode[i])>
</cfif><cfif getDestHotelList.countrycode[i] NEQ "US">
#getDestHotelList.countrycode[i]#
</cfif></cfoutput></a><br>
</cfif>
<font color="#770000">
<cfset i = i + 1>
</font>
</cfloop></td>
</tr>
</table>



<cfif Len(CALLER.getHotelDestNames.hotelDestSoonIn[ATTRIBUTES.destId])>
<font color="#770000"><br>
</font><br>
<cfoutput>#replace( CALLER.getHotelDestNames.hotelDestSoonIn[ATTRIBUTES.destId], "#chr(10)#", "<br>", "ALL")#</cfoutput>
</cfif>



If anyone would like to help me out i would really appreciate it. I am a bit stuck here and a guiding hand would do wonders... Thanks in advance.


_dancegruv

Reply With Quote
  #2  
Old January 21st, 2005, 08:08 AM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,682 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 15 h 25 m 55 sec
Reputation Power: 53
Could you please trim this code down to a short script that just demonstrates the actual problem? I don't have the time to read through all that code. Eliminate all the extraneous stuff.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > CFM / Javascript help


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT