View Full Version : Help with Chained Selects Menu

04-06-2005, 07:27 PM
This post refers to the following script:
Chained Selects Menu Script

After downloading the necessary files and playing around with it, when I tested the script It worked like a charm. But when I try and put the html code in my own template it breaks. Which would lead me to believe that something in my html template code is causing the script to break, but I cannot figure it out. Anyone care to help.
I am using all the original files located at the URL above. I have modified the sample.html file with my template. I am attatching the new file as sample2.txt
Thanks for any insight,

04-06-2005, 09:35 PM
That's some template! Anyways, this:
<link title="WDNR Master Style Sheet" href="/css/dnr.css" type="text/css" rel="stylesheet">depending on what it says in dnr.css could be a problem. Especially if it changes the display of tables and their contents.


<LINK REL=SCHEMA.dc HREF="http://purl.org/dc/documents/rec-dces-19990702.htm">may introduce other conflicting elements. perhaps even scripts, depending on what rec-dces-19990702.htm has on it. I'm not familiar with the SCHEMA.dc REL, it may not be the type of link that can cause problems

<!--#include virtual="/includes/footer.inc"-->here's another, depends on what's in footer.inc

<LINK REL=SCHEMA.DC HREF="http://www.dpi.state.wi.us/dltcl/rll/pdf/wicv.pdf">this might be trouble too, probably not, as it is a .pdf file.

To tell If any of these is causing the problem remove them and see if that fixes it. If so, add them back one at a time to find the offending one(s). Once you find the problem one(s) you need to look at the actual code it adds to see if there is a way to either compensate with changes to your page or to the script you want to use.

04-07-2005, 01:26 PM
Thanks for the suggestions. I appreciate your time in looking at my problem. Unfortunately I tried what you suggested (removing the offending code) and it did not work. So it must be something else... I'll keep trying to figure it out.

04-07-2005, 03:50 PM
Just as clarification, the code is innocent until proven guilty. Not as a matter of fairness, but one of logic. I'll have another look at your sample. Does the page work locally?

04-07-2005, 03:57 PM
I missed two suspects:
<!-- #include virtual="/includes/header.inc" -->and:
<!--#include virtual="/invasives/includes/leftnavlong.inc"--> running the page locally would prevent all these suspicious links and includes from having any effect, as long as you don't have them on or linked via network to your local computer. Good for testing.

04-07-2005, 06:16 PM
Well I tried the page locally and it does not work. I am attatching the original file with out the template as sample.txt
When I tried this locally it did work, so.... It must be something silly I did in the sample2.txt file to make it break...
Thanks for comparing the 2 files again and for all your help with this

04-07-2005, 07:08 PM
part of the problem:

<td width="484"><a name="content"></a>
<div id="content">added in the template, conflicts with variable 'content' and/or use of names and/or id's called 'content' in the chainedmenu.js script.


1) Don't use this in the template, or ---
2) Change all references in chainedmenu.js to 'content' to another word, like 'stuff' Make sure the HTML markup on your page agrees with this and the other script file too. (if they mention content, change it there too, just not in the template language shown above)

There seems to be another problem though, all fields are available onload but, at least they are there, could just be an artifact of my trouble shooting process. Take care of this problem and let me know.

04-07-2005, 08:37 PM
I changed the work content in the .js file and now it seems to work....
What was the other problem you alluded to in your last post?

04-07-2005, 08:45 PM
As I said, it may have been an artifact of the debugging process. You see these chained selects have a persistence feature. While I saw nothing in the boxes, the persistence was probably still setting things up. So, when I fixed it, things looked odd. All the boxes looked active. I figured I'd let you check it out fresh first before worrying about it.