Solved

Help I have an error

Posted on 2011-09-14
21
285 Views
Last Modified: 2012-05-12
Hi,

I have this error that drives me crazy for two days.

this is my site

http://www.churchesbulletin.com/

I am having problem with pulling the record this:

ChurchID = 14420
ChCityID = 4745
ChStateID = 35

I am not sure what in this record is wrong?

there is no empty spaces I don't see anything wrong with it.

My javascript works fine if I select the data <=  14419

in my select statement if I have this it works fine no javascript error
and ChurchTbl.ChurchID <=  14419

if I change my select statement to <=  14420
my javascript will not work.

something wrong with my record 14420  and I don't know how to fix it.
or what's wrong.  

I need help help I need help and help.

Thanks,


0
Comment
Question by:lulu50
  • 11
  • 7
  • 3
21 Comments
 
LVL 82

Expert Comment

by:hielo
ID: 36538478
How exactly are you getting/seeing this error? That page only shows "lists".
0
 

Author Comment

by:lulu50
ID: 36538584
oh hielo good to hear from you
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 36538624
Did you notice that your generated HTML page does have 53000 lines and that one of the lines has 84000 characters?

0
 

Author Comment

by:lulu50
ID: 36538630
Ok I don't know if you remember the folder that you have helped me with.

when I downloaded all the state, city, and churches of Michigan and Ohio.

the data was huge and the folder took a long time to get upload so, I removed it

 and changed my design to this.

0
 

Author Comment

by:lulu50
ID: 36538643
How can I do this with so much data to upload?
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 36538649
The magic word is: AJAX <|:-)
0
 

Author Comment

by:lulu50
ID: 36538672
but I am using coldfusion server!
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 36538674
0
 
LVL 82

Expert Comment

by:hielo
ID: 36538714
>>Ok I don't know if you remember the folder that you have helped me with.
Was it the one that had some sort of "Tree" structure?

Anyway, how are you "triggering" that error on the page you posted?
0
 

Author Comment

by:lulu50
ID: 36538796
yes the Tree structure


Zvonko  can you please take a look at
this page

http://www.churchesbulletin.com/test.cfm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
      <title>Related cfselects</title>
</head>

<body>
<cfform name="myform" format="flash" width="400">

</cfform>
</body>
</html>

why do I have an error
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

Author Comment

by:lulu50
ID: 36538808
how are you "triggering" that error on the page you posted?

Oh, this is driving me crazy

In my select statement if I do  <=  14419  it works

but after 14420 does not work  
0
 

Author Comment

by:lulu50
ID: 36538837
Zvonko

I think what Zvonko says will be the best approach to this.

I have change my design and use AJAX coldfusion instead of javascript.
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 36538979
What version of ColdFusion server do you use?
0
 
LVL 82

Expert Comment

by:hielo
ID: 36539074
>>In my select statement i
You mean in your DB Query correct? If so, most likely the number of results is too much for the amount of available memory.

>>I have change my design and use AJAX coldfusion instead of javascript.
AJAX is not a programing language. You will still be using javascript to fetch the data you need. Without AJAX, you've been sending ALL the data at once. With AJAX, you only send only the needed "portions" of data you need as needed. But yes, I agree, ajax is the way to go here.
0
 

Author Comment

by:lulu50
ID: 36539121
Zvonko,

The hosting company use coldfusion mx6.1 and 7 versions
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 36539216
Can you please post your CFQUERIES because I would like to create the same DB structure as yours for the examples?
0
 

Author Comment

by:lulu50
ID: 36539701
Zvonko

Yes thank you


This is to populate the state:

	<CFQUERY DATASOURCE="lulu50_ChurchesBulleti" NAME="DispState" cachedwithin="#createTimeSpan(0,0,0,-1)#">
		SELECT distinct StateTbl.StateID, StateTbl.StateName
		FROM StateTbl
		LEFT JOIN CityTbl ON CityTbl.StateID = StateTbl.StateID
		LEFT JOIN ChurchTbl ON ChurchTbl.ChCityID = CityTbl.CityID
		WHERE ChurchTbl.ChurchName <> "null" and ChurchTbl.ChurchStatus = 1
		and CityTbl.CityStatus = 1 and StateTbl.StateStatus = 1
		order by StateTbl.StateName ASC
	</CFQUERY>	


this is to select the state

<select name="GetCity" style="width: 180px;height:200px;" size="8" multiple="multiple"
onChange="setOptionsCH(this.options[this.selectedIndex].value);"/>
<cfoutput>
<cfloop from="1" to="#listlen(myCitiesList)#" index="i" step="3">
<option value="#listgetat(myCitiesList,i+1)#">#listgetat(myCitiesList,i+2)#</option>
</cfloop>
</cfoutput>
</select> 
________________________________________________________________________________

This is the cfquery to populate the city

<CFQUERY DATASOURCE="lulu50_ChurchesBulleti" NAME="GetCities" cachedwithin="#createTimeSpan(0,0,0,-1)#">
SELECT distinct StateTbl.StateID, CityTbl.CityID, CityTbl.CityName
FROM StateTbl
LEFT JOIN CityTbl ON CityTbl.StateID = StateTbl.StateID
LEFT JOIN ChurchTbl ON ChurchTbl.ChCityID = CityTbl.CityID
WHERE ChurchTbl.ChurchName <> "null" and ChurchTbl.ChurchStatus = 1
and CityTbl.CityStatus = 1 and StateTbl.StateStatus = 1  
order by CityTbl.CityName ASC
</CFQUERY>

<cfset myArrayCities = ArrayNew(1)> 
<cfloop query = "GetCities"> 
    <cfset DisplayDataCities = ArrayAppend(myArrayCities,"#StateID#,#CityID#,#CityName#")> 
</cfloop> 
	<cfset myCitiesList = ArrayToList(myArrayCities, ",")> 

I get the data from myCitiesList list 


this is to select the city

<select name="GetCity" style="width: 180px;height:200px;" size="8" multiple="multiple"
onChange="setOptionsCH(this.options[this.selectedIndex].value);"/>
<cfoutput>
<cfloop from="1" to="#listlen(myCitiesList)#" index="i" step="3">
<option value="#listgetat(myCitiesList,i+1)#">#listgetat(myCitiesList,i+2)#</option>
</cfloop>
</cfoutput>
</select>

 ________________________________________________________________________________


This is the cfquery to populate the churches

<CFQUERY DATASOURCE="lulu50_ChurchesBulleti" NAME="DispChbyCity" cachedwithin="#createTimeSpan(0,0,0,-1)#">
SELECT CityTbl.CityID, ChurchTbl.ChurchID, trim(ChurchTbl.ChurchName) as ChurchName
FROM StateTbl 
LEFT JOIN CityTbl ON CityTbl.StateID = StateTbl.StateID
LEFT JOIN ChurchTbl ON ChurchTbl.ChCityID = CityTbl.CityID
WHERE ChurchTbl.ChurchName <> "null" and ChurchTbl.ChurchStatus = 1
and CityTbl.CityStatus = 1 and StateTbl.StateStatus = 1
and ChurchTbl.ChurchID >= 1 
order by ChurchTbl.ChurchName ASC 
</CFQUERY>

<cfset myArrayCH = ArrayNew(1)> 

<cfloop query = "DispChbyCity"> 
    <cfset DisplayDataCH = ArrayAppend(myArrayCH,"#trim(CityID)#,#trim(ChurchID)#,#trim(ChurchName)#")> 
</cfloop> 

<cfset myChurchList = ArrayToList(myArrayCH, ",")>  

I get the list result from myChurchList 

<select name="GetChurch" style="width: 250px; height: 200px;" size="8" multiple>
<cfif isdefined('form.GetCity')>
<cfoutput>
<cfloop from="1" to="#listlen(myChurchList)#" index="i" step="3">
<option value="#listgetat(myChurchList,i+1)#">#listgetat(myChurchList,i+2)#</option>
</cfloop>
</cfoutput>
</cfif>
</select>

Open in new window

0
 
LVL 63

Accepted Solution

by:
Zvonko earned 500 total points
ID: 36540128
OK, here we go.
You need this two CFM files:
 getOptCityName.cfm.txt getOptChurchName.cfm.txt
   

And you need this script in your index.cfm
<script>
function getSelOptions(theRequest,theTarget){
  var xmlhttp;
  if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
    xmlhttp=new XMLHttpRequest();
  } else {// code for IE6, IE5
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
  theRequest=theRequest+"&t="+(new Date()).getTime();
  xmlhttp.open("GET",theRequest,false);
  xmlhttp.send();
  newOpt=eval(xmlhttp.responseText);
  var opt = theTarget.options;
  opt.length=0;
  for(var i=0;i<newOpt.length;i++){
    opt[i] = new Option(newOpt[i][1],newOpt[i][0]);
  }
}
</script>

Open in new window


And you call that script like this:
<select name="DispStateBox" style="width: 180px;height:200px;" size="8"  onChange="getSelOptions('getOptCityName.cfm?selval='+this.value,this.form.GetCity);">
			 <cfoutput>
			 <cfloop query="selStateTbl">
			   <option value="#ChStateID#">#StateName#)</option>
			 </cfloop>
			 </cfoutput>
</select>

Open in new window

And like this:
<select name="GetCity" style="width: 180px;height:200px;" size="8" 
onChange="getSelOptions('getOptChurchName.cfm?selval='+this.value,this.form.GetChurch);"/> </select>

Open in new window


Remove those visibility:hidden settings.
0
 

Author Comment

by:lulu50
ID: 36540757
Zvonko

Great!!!!

it is fast and it is taking all my data prefect.  

now I have to get the filter to work I will search the net for any idea but
if you know an example please let me know.

I will open a new question for it.  

Thank you so much for helping me.  

This is great!!!!!!
0
 

Author Closing Comment

by:lulu50
ID: 36540762
Great job Great answer thank you thank you and thank you
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 36541133
You are welcome <|:-)
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now