PDA

View Full Version : Form Dependency Not Working With Top Navigational Menu Script



francoom
08-22-2011, 03:39 AM
Hello. Your form dependency is working great, but when included on a page with the top navigational menu script, the form dependency won't work.

Test Pages:
www.cecilelicad.com/test/test.html
www.cecilelicad.com/test/test2.html
www.cecilelicad.com/test/test3.html

Pls help.... :(

jscheuer1
08-22-2011, 04:21 AM
Hello. Your form dependency is working great, but when included on a page with the top navigational menu script, the form dependency won't work.

These are two older scripts and their authors aren't around. Oh and:

Your page is in violation of Dynamic Drive's usage terms (http://www.dynamicdrive.com/notice.htm), which, among other things, state that the script credit must appear in the source code of the page(s) using the script. Please reinstate the notice first.

And:

Please post new questions in a new thread like here where I've moved this, and:

Warning: Please include a link to the DD script(s) in question in your post. See this post (http://www.dynamicdrive.com/forums/showpost.php?p=7) for more information.

That said, it's an onload conflict. Both scripts want control of the onload event. To fix it, replace:


<script type="text/javascript">
window.onload = function() {
setupDependencies('weboptions');
};
</script>

with:


<script type="text/javascript">
(function(){
var func = function() {
setupDependencies('weboptions');
};
if (window.addEventListener){
window.addEventListener('load', func, false);
}
else if (window.attachEvent){
window.attachEvent('onload', func);
}
})();
</script>