31/10/2011, 15:50
|
| | Fecha de Ingreso: septiembre-2011 Ubicación: Culiacan, Sinaloa, Mexico
Mensajes: 10
Antigüedad: 13 años, 2 meses Puntos: 1 | |
Respuesta: Doble select con autosubmit Ok que te parece esta solucion Cita: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script>
var pag = location.href.split('?')[1];
if(pag != undefined)
{
var Url = location.href;
Url = Url.replace(/.*\?(.*?)/,"$1");
Variables = Url.split ("&");
for (i = 0; i < Variables.length; i++)
{
Separ = Variables[i].split("=");
eval ('var '+Separ[0]+'="'+Separ[1]+'"');
}
}
window.onload=function() {
document.getElementById('selectelement1').onchange =function() {
if(pag == undefined)
{
document.getElementById('selectform1').submit();
}
else
{
location.href="mipagina.php?selectelement2="+ selectelement2+"&"+ "selectelement1=" + document.getElementById('selectelement1').value;
}
}
document.getElementById('selectelement2').onchange =function() {
if(pag == undefined)
{
document.getElementById('selectform1').submit();
}
else
{
location.href="mipagina.php?selectelement1="+ selectelement1 +"&"+ "selectelement2=" + document.getElementById('selectelement2').value;
}
}
}
</script>
</head>
<body>
<form name="selectform1" id="selectform1">
<select name="selectelement1" id="selectelement1" size="3">
<option value="1" >Option 1</option>
<option value="2" >Option 2</option>
<option value="3" >Option 3</option>
<option value="4" >Option 4</option>
</select>
<br>
<select name="selectelement2" id="selectelement2" size="3">
<option value="1" >Option 1</option>
<option value="2" >Option 2</option>
<option value="3" >Option 3</option>
<option value="4" >Option 4</option>
</select>
</form>
</body>
</html> suerte |