Thanks ever so much for the responses guys
@ onion2k Tested this and it works very well thanks, only thing I don't like is that it requires a submit button...and I'm not sure I want to use a submit button :S
Seems like a catch 22 situation since
califdon's comment seems to rule out a PHP replacement for the JavaScript due to the client-side/server-side issue (thanks for clearing that up by the way,
califdon, it makes much more sense now) which is a shame as I am not a fan of using JavaScript.
@ Ziq Also tried this and it works great so thanks a lot for that

One down, one to go!
Using the JavaScript version might not be so bad anyway, since the reason for the jump menu is simply to "filter" some of the images in my portfolio but the full list of images will be shown on a single page anyway so the user can access the image, filtered or not, either way - if that makes sense!
Which brings me to another point that I hope you genius's can help me with...I've expanded the jump menu (while awaiting some advice from this forum) so there are now
four jump menus consisting of
Client,
Industry,
Platform and
Service where users can select from any of the jump menus to dynamically display the relevant content - basically filtering and narrowing down the images shown in a portfolio (template.php).
Again this works beautifully, the only issue is that all four content includes are displayed on the page at the same time when I only want
one include to be displayed at any given time, with this content include area dynamically changing according the the selection made by the users from the four jump menus.
Basically it needs something like a conditional statement to display the relevant include depending on what the user selects from the jump menu/s. But since the code is a switch statement, it is more or less alsready an if else statement hence why I can't seem to work it out. I think I've done okay for a PHP novice mind you! : P Ha
I hope this makes sense? Let me know if it doesn't.
Anyway here is the code:
Template.php
Code: Select all
<?php
//Include page header
include('menu.php');
/////////////////////////////////////////FIRST JUMP MENU CONTENT///////////////////////////////////////////////////
//Get the page variable
$client = $_GET['client'];
//Our switch statement to get the right content
switch($client) {
case "c01": //For each page of content just add a case block
$contentc = "c01.html"; //The file with the page contents. DO not include the header and footer HTML in these files it is already added.
break; //Stop the case block, if you do not have this you will get an error.
case "c02":
$contentc = "c02.html";
break;
case "c03":
$contentc = "c03.html";
break;
case "c04":
$contentc = "c04.html";
break;
default: //If the variable didn't match any of the above cases do this.
$contentc = "c01.html";
break;
}
//Include the selected content.
include($contentc);
/////////////////////////////////////////SECOND JUMP MENU CONTENT///////////////////////////////////////////////////
$industry = $_GET['industry'];
switch($industry) {
case "i01": //For each page of content just add a case block
$contenti = "i01.html"; //The file with the page contents. DO not include the header and footer HTML in these files it is already added.
break; //Stop the case block, if you do not have this you will get an error.
case "i02":
$contenti = "i02.html";
break;
case "i03":
$contenti = "i03.html";
break;
case "i04":
$contenti = "i04.html";
break;
default: //If the variable didn't match any of the above cases do this.
$contenti = "i01.html";
break;
}
include($contenti);
/////////////////////////////////////////THIRD JUMP MENU CONTENT///////////////////////////////////////////////////
$platform = $_GET['platform'];
switch($platform) {
case "p01": //For each page of content just add a case block
$contentp = "p01.html"; //The file with the page contents. DO not include the header and footer HTML in these files it is already added.
break; //Stop the case block, if you do not have this you will get an error.
case "p02":
$contentp = "p02.html";
break;
case "p03":
$contentp = "p03.html";
break;
case "p04":
$contentp = "p04.html";
break;
default: //If the variable didn't match any of the above cases do this.
$contentp = "p01.html";
break;
}
include($contentp);
/////////////////////////////////////////FOURTH JUMP MENU CONTENT///////////////////////////////////////////////////
$service = $_GET['service'];
switch($service) {
case "s01": //For each page of content just add a case block
$contents = "s01.html"; //The file with the page contents. DO not include the header and footer HTML in these files it is already added.
break; //Stop the case block, if you do not have this you will get an error.
case "s02":
$contents = "s02.html";
break;
case "s03":
$contents = "s03.html";
break;
case "s04":
$contents = "s04.html";
break;
default: //If the variable didn't match any of the above cases do this.
$contents = "s01.html";
break;
}
include($contents);
?>
menu.php
Code: Select all
<p>How would you like to filter the projects?</p>
<p>By
<form name="form1">
<select name="CLIENT" onChange="jumpMenu('parent',this,0)">
<option value="template03.php" <?php if ($_GET['client'] == 'template03.php') echo 'selected' ?>>CLIENT</option>
<option value="template03.php?client=c01" <?php if ($_GET['client'] == 'c01') echo 'selected' ?>>Client 01</option>
<option value="template03.php?client=c02" <?php if ($_GET['client'] == 'c02') echo 'selected' ?>>Client 02</option>
<option value="template03.php?client=c03" <?php if ($_GET['client'] == 'c03') echo 'selected' ?>>Client 03</option>
<option value="template03.php?client=c04" <?php if ($_GET['client'] == 'c04') echo 'selected' ?>>Client 04</option>
</select>
</form>
or
<form name="form2">
<select name="INDUSTRY" onChange="jumpMenu('parent',this,0)">
<option value="template03.php" <?php if ($_GET['industry'] == 'template03.php') echo 'selected' ?>>INDUSTRY</option>
<option value="template03.php?industry=i01" <?php if ($_GET['industry'] == 'i01') echo 'selected' ?>>Industry 01</option>
<option value="template03.php?industry=i02" <?php if ($_GET['industry'] == 'i02') echo 'selected' ?>>Industry 02</option>
<option value="template03.php?industry=i03" <?php if ($_GET['industry'] == 'i03') echo 'selected' ?>>Industry 03</option>
<option value="template03.php?industry=i04" <?php if ($_GET['industry'] == 'i04') echo 'selected' ?>>Industry 04</option>
</select>
</form>
or
<form name="form3">
<select name="PLATFORM" onChange="jumpMenu('parent',this,0)">
<option value="template03.php" <?php if ($_GET['platform'] == 'template03.php') echo 'selected' ?>>PLATFORM</option>
<option value="template03.php?platform=p01" <?php if ($_GET['platform'] == 'p01') echo 'selected' ?>>Platform 01</option>
<option value="template03.php?platform=p02" <?php if ($_GET['platform'] == 'p02') echo 'selected' ?>>Platform 02</option>
<option value="template03.php?platform=p03" <?php if ($_GET['platform'] == 'p03') echo 'selected' ?>>Platform 03</option>
<option value="template03.php?platform=p04" <?php if ($_GET['platform'] == 'p04') echo 'selected' ?>>Platform 04</option>
</select>
</form>
or
<form name="form4">
<select name="SERVICE" onChange="jumpMenu('parent',this,0)">
<option value="template03.php" <?php if ($_GET['service'] == 'template03.php') echo 'selected' ?>>SERVICE</option>
<option value="template03.php?service=s01" <?php if ($_GET['service'] == 's01') echo 'selected' ?>>Service 01</option>
<option value="template03.php?service=s02" <?php if ($_GET['service'] == 's02') echo 'selected' ?>>Service 02</option>
<option value="template03.php?service=s03" <?php if ($_GET['service'] == 's03') echo 'selected' ?>>Service 03</option>
<option value="template03.php?service=s04" <?php if ($_GET['service'] == 's04') echo 'selected' ?>>Service 04</option>
</select>
</form>
I know the way I have done it is probably over-complicated but hey - if it ain't broken, don't fix it! : P let me know what you guys think nonetheless.
Thanks again guys, your help is appreciated.
Darren