Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 300
  • Last Modified:

Help I have an error

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
lulu50
Asked:
lulu50
  • 11
  • 7
  • 3
1 Solution
 
hieloCommented:
How exactly are you getting/seeing this error? That page only shows "lists".
0
 
lulu50Author Commented:
oh hielo good to hear from you
0
 
ZvonkoSystems architectCommented:
Did you notice that your generated HTML page does have 53000 lines and that one of the lines has 84000 characters?

0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
lulu50Author Commented:
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
 
lulu50Author Commented:
How can I do this with so much data to upload?
0
 
ZvonkoSystems architectCommented:
The magic word is: AJAX <|:-)
0
 
lulu50Author Commented:
but I am using coldfusion server!
0
 
hieloCommented:
>>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
 
lulu50Author Commented:
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
 
lulu50Author Commented:
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
 
lulu50Author Commented:
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
 
ZvonkoSystems architectCommented:
What version of ColdFusion server do you use?
0
 
hieloCommented:
>>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
 
lulu50Author Commented:
Zvonko,

The hosting company use coldfusion mx6.1 and 7 versions
0
 
ZvonkoSystems architectCommented:
Can you please post your CFQUERIES because I would like to create the same DB structure as yours for the examples?
0
 
lulu50Author Commented:
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
 
ZvonkoSystems architectCommented:
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
 
lulu50Author Commented:
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
 
lulu50Author Commented:
Great job Great answer thank you thank you and thank you
0
 
ZvonkoSystems architectCommented:
You are welcome <|:-)
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 11
  • 7
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now