View Full Version : Chained menu not working

09-25-2017, 07:09 PM
1) Script Title: Chained Menu

2) Script URL (on DD): http://dynamicdrive.com/dynamicindex16/chainedselects/index.htm

3) Describe problem: I used to have the script working on f.ex. https://croatia-luxury-villa.com/dalmatia/, but now suddenly it seems not to work anymore.
I added a js-function in the head, besides the one in the body tag.
Here's the links to the two js-files:
- https://croatia-luxury-villa.com/js/chainedmenu.js
- https://croatia-luxury-villa.com/js/configvillas.js
Could anyone please let me know wht suddenly went wrong, as it all worked fine before.

09-25-2017, 09:52 PM
In this page: https://croatia-luxury-villa.com/js/configvillas.js
When it is set up to open in a new window, all works fine, like this:

var newwindow=1 //Open links in new window or not? 1=yes, 0=no.
But when it is set to open in the same window (var newwindow=0), then the link doesn't open.
How come, please?

09-26-2017, 02:22 PM
I'm responding here because this is where you first asked about this, and it should be separate. In the other thread where you mentioned it though, I see you were using a loader function to initiate this script. That's fine, you can do that. But if you do, you should not load it a second time using the body onload attribute.

Now, once you've got that settled, the problem with opening the selection in the same window is that the form submits before that happens. To prevent that, add the highlighted to the HTML portion of the code:

<form name="listmenu0" class="form" onsubmit="return false;">
<div class="row">
<select class="c-input size-2" name="firstlevel"></select>
<select class="c-input size-2" name="secondlevel"></select>
<select class="c-input size-2" na . . .

09-26-2017, 07:24 PM
Great stuff, John.