Seleccionar menu
Publicado por Unexes (124 intervenciones) el 03/03/2014 09:09:27
Hola a tod@s.
Bueno se me ha presentado un pequeño problema que no se como resolver a ver si me podeis ayudar.
En mi página tengo un select que al cambiar la seleccion me cambia el contenido que me presenta "ContenidoPresentacion" esto funciona bien, pero lo que necesito es que tambien me cambie el menu lateral osea si selecciono en el select "Alquiler" me ponga el menu correspondiente a "MenuLateralAlquileres.php" y si selecciono en el select "Compra" me muestre el menu "MenuLateralCompra".
Bueno este es mi código:
Espero me podais ayudar muchas Gracias a tod@s.
Bueno se me ha presentado un pequeño problema que no se como resolver a ver si me podeis ayudar.
En mi página tengo un select que al cambiar la seleccion me cambia el contenido que me presenta "ContenidoPresentacion" esto funciona bien, pero lo que necesito es que tambien me cambie el menu lateral osea si selecciono en el select "Alquiler" me ponga el menu correspondiente a "MenuLateralAlquileres.php" y si selecciono en el select "Compra" me muestre el menu "MenuLateralCompra".
Bueno este es mi código:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<script type='text/javascript'>
function cargarContenido(pagina)
{
if(parseInt($("#PreMin").val())>parseInt($("#PreMax").val()))
{
$("#PreMin").val($("#PreMax").val());
}
if(parseInt($("#SupMin").val())>parseInt($("#SupMax").val()))
{
$("#SupMin").val($("#SupMax").val());
}
$("#ContenidoPresentacion").html("<img src='Imagenes/loadingbar-green2.gif' class='clock' border='0'>");
$("#ContenidoPresentacion").load(pagina, $("#filtrar,#filtrar2").serialize());
}
</script>
</head>
<body>
<form name="filtrar" id="filtrar" method="GET" action="">
<div id="Modalidad">
<table height="60" border="0">
<tr>
<td align="center">
<select name="selmodalidad" id="selmodalidad" class="Guias3" Onchange="cargarContenido('ContenidoPresentacion.php')">
<?php
if ( isset($_GET['selmodalidad']) ){
echo '<option value="-1" > Todos los Tipos </option>';
}else{
echo '<option value="-1" selected > Todos los Tipos </option>';
}
$tablamodalidad = mysql_query("SELECT * FROM tb_modalidad ORDER BY Modalidad ASC");
while ($registromodalidad = mysql_fetch_array($tablamodalidad)){
if( isset($_GET['selmodalidad']) and $_GET['selmodalidad']==$registromodalidad['Modalidad'] ){
$seleccionado = "selected";
}else{
$seleccionado = "";
}
echo "<option value='".$registromodalidad['Modalidad']."' $seleccionado >".$registromodalidad['Modalidad']."</option>";
}
mysql_free_result($tablamodalidad);
?>
</select>
</td>
</tr>
</table>
</div>
</form>
<div id="ContenidoPresentacion"><?php require ("ContenidoPresentacion.php"); ?></div>
<div id="FiltradoAlquileres">
<?php if (isset ($_GET['selmodalidad']) and $_GET['selmodalidad'] == 'Alquiler') {
require ("MenusLaterales/MenuLateralAlquileres.php");
}else{
if (isset ($_GET['selmodalidad']) and $_GET['selmodalidad'] == 'Compra') {
require ("MenusLaterales/MenuLateralCompra.php");
}else{
}
}?>
</div>
</body>
Valora esta pregunta


0