Jump to content
xisto Community
Sign in to follow this  
kvarnerexpress

Getting A Link From Dropdownmenu In A Layer ?!1

Recommended Posts

I have been wrestling with this issue some time now and can't figure it out.I have a dropdownmenu with some data (pulled from a database using php, but that's unimportant).Now when one selects a item form that menu I want the page to which that item links to be opened in a layer.There are 2 things Going on:1. I use javascripts include('layer','content.php'); function to load a page in a layer. Works like a charme.2. the dropdown menu CAN open the page to which the items link in the same page using:<SELECT NAME="SelectURL" onChange="document.location.href=document.nav.SelectURL.options[document.nav.SelectURL.selectedIndex].value">Works great too.WHAT I DID TO COMBINE THIS:<SELECT NAME="albums" id="albums" class="table" onChange="include('thumbnaillayer', 'document.nav.SelectURL.options[document.nav.SelectURL.selectedIndex].value ');">seemed logical to me. only what happens in real is this error:Not FoundThe requested URL /ghbstoernooi/document.nav.SelectURL.options[document.nav.SelectURL.selectedIndex].value was not found on this server.--------------------------------------------------------------------------------Apache/1.3.29 Server at localhost Port 80What is going on here?I can't be too far away form the solution since steps 1 and 2 work great. But I need a little push in the right direction....Please, any help would be awesome! Thanks a lot in advance!

Share this post


Link to post
Share on other sites

What you are trying to do is run a server side code in the client. "include" is server side (php) code. Whatever is executed on "onchange" of dropdown *has* to be client side code since your browser doesn't know about server code. That doesn't work. if you want to include something, you can redirect browser to a pageinclude.php script with a parameter (depending on the selection of dropdown) and in your php, depending on parameter, you can include respective file.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.