pilarvalsala
asked on
Dynamic drop down menu
HELLO
i HAVE THIS CODE, BUT I DON´T WANT TO HAVE TO CLICK THE OK BUTTON TO MAKE CHANGES AT THE DROP DOWN MENUS, HOW CAN I MAKE IT AUTOMATICALLY, ONCE THE FIRST ONE CHANGES, THE SECOND DOES GIVE ME ONLY THE INFO BELONGING TO IT AUTOMATICALLY AND THE THIRD ONE THE SAME???
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%Option Explicit%>
<%Response.Buffer = True%>
<html>
<head>
<title>Menu Prueba</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style3 {font-family: Verdana, Arial, Helvetica, sans-serif; color: #993333; }
-->
</style>
</head>
<%
Dim strDataPath, strConnectString, objConnection
Dim strSistema, strEquipo, strElemento, objRS, strSelected, strSQL
strSistema = Request.Form("Sistema")
strEquipo = Request.Form("Equipo")
strElemento = Request.Form("Elemento")
'set connection strings for entire application
strDataPath = Server.MapPath("analisis.m db")
strConnectString = "Provider=Microsoft.Jet.OL EDB.4.0;"_
+ " Data Source= " & strDataPath & ";"
If Not IsObject("ojbConnection") Then
Set objConnection=Server.Creat eObject("A DODB.Conne ction")
objConnection.ConnectionTi meout = 15
objConnection.CommandTimeo ut = 10
objConnection.Mode = 3 'adModeReadWrite
If objConnection.state = 0 Then
objConnection.Open strConnectString
End If
End If
%>
<%
Sub makeSistema()
If Not IsObject("objRS") Then
Set objRS=Server.CreateObject( "ADODB.Rec ordSet")
End If
If objRS.state <> 0 Then
objRS.close
End If
strSQL = "SELECT Sis_Codi FROM Sistemas"
objRS.Open strSQL,objConnection,3,3
Response.Write("<option></ option>" & vbCrLf )
Do While Not objRS.EOF
If objRS("Sis_Codi") = strSistema Then
strSelected = " Selected "
Else
strSelected = ""
End If
Response.Write("<option" & strSelected & ">" &_
objRS("Sis_Codi") & "</option>" & vbCrLf )
objRS.MoveNext
Loop
objRS.Close
Set objRS=Nothing
End Sub
%>
<%
Sub makeEquipo()
If strSistema <> "" Then
If Not IsObject("objRS") Then
Set objRS=Server.CreateObject( "ADODB.Rec ordSet")
End If
If objRS.state <> 0 Then
objRS.close
End If
strSQL ="SELECT Equ_Codi FROM Equipos WHERE Sis_Codi = '" &_
strSistema & "' ORDER BY Equ_Codi"
objRS.Open strSQL,objConnection,3,3
If objRS.eof Then
Response.Write("<option>No Se Encontraron Equipos</option>")
Else
Response.Write("<option>Se leccione un Equipo Ahora</option>" & vbCrLf )
Do While Not objRS.EOF
If objRS("Equ_Codi") = strEquipo Then
strSelected = " Selected "
Else
strSelected = ""
End If
Response.Write("<option" & strSelected & ">" &_
objRS("Equ_Codi") & "</option>" & vbCrLf )
objRS.MoveNext
Loop
End If
objRS.Close
Set objRS=Nothing
Else
Response.Write("<option>Se leccione un Equipo Primero </option>")
End If
End Sub
Sub makeElemento()
If strEquipo <> "Seleccione un Sistema Primero" And _
strEquipo <> "Seleccione un Elemento Ahora" And strEquipo <>"" Then
If Not IsObject("objRS") Then
Set objRS=Server.CreateObject( "ADODB.Rec ordSet")
End If
If objRS.state <> 0 Then
objRS.close
End If
strSQL = "SELECT Equ_Desc FROM Equipos WHERE Equ_Codi = '" &_
strEquipo & "' ORDER BY Equ_Codi"
objRS.Open strSQL,objConnection,3,3
If objRS.eof Then
Response.Write("<option>No Descriptions Found</option>")
Else
Response.Write("<option>Se lect Description Now</option>" & vbCrLf )
Do While Not objRS.EOF
If objRS("Equ_Desc") = strElemento Then
strSelected = " Selected "
Else
strSelected = ""
End If
Response.Write("<option" & strSelected & ">" &_
objRS("Equ_Desc") & "</option>" & vbCrLf )
objRS.MoveNext
Loop
End If
objRS.Close
Set objRS=Nothing
Else
Response.Write("<option>Se lect a Region First</option>")
End If
End Sub
%>
<SCRIPT LANGUAGE=javascript>
<!--
Function submitSistema(){
var objForm = document.forms[0];
objForm.elements['Equipo'] .selectedI ndex=0;
objForm.elements['Elemento '].selecte dIndex = 0;
objForm.submit();
}
Function submitEquipo(){
var objForm = document.forms[0];
objForm.elements['Elemento '].selecte dIndex = 0;
objForm.submit();
}
//-->
</SCRIPT>
<SCRIPT LANGUAGE=javascript>
<!--
Function submitForm(){
var objForm = document.forms[0];
objForm.action = "http://localhost/mantenimiento/Test/menustest.asp"
return true;
}
//-->
</SCRIPT>
<body>
<FORM action="" method=POST id=form1 name=form1 onSubmit="return submitForm()">
<table width="80%" border="0">
<tr>
<td width="44%"><span class="style3">Sistema</sp an></td>
<td width="56%"><select name="Sistema" onChange="submitSistema()" >
<%call makeSistema%>
</select>
<input type="submit" value="OK" id=submit12 name=submit1></td>
</tr>
<tr>
<td><span class="style3">Equipos</sp an></td>
<td><select name="Equipo" onChange="submitEquipo()">
<%call makeEquipo%>
</select>
<input type="submit" value="OK" id=submit1 name=submit12></td>
</tr>
<tr>
<td><span class="style3">Elementos a Gráficar </span></td>
<td><select name="Elemento">
<%call makeElemento%>
</select>
<input type="submit" value="OK" id=submit13 name=submit13></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
</FORM>
</BODY>
<%
objConnection.Close
Set objConnection = Nothing
%>
</html>
Thank you for your help!
i HAVE THIS CODE, BUT I DON´T WANT TO HAVE TO CLICK THE OK BUTTON TO MAKE CHANGES AT THE DROP DOWN MENUS, HOW CAN I MAKE IT AUTOMATICALLY, ONCE THE FIRST ONE CHANGES, THE SECOND DOES GIVE ME ONLY THE INFO BELONGING TO IT AUTOMATICALLY AND THE THIRD ONE THE SAME???
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%Option Explicit%>
<%Response.Buffer = True%>
<html>
<head>
<title>Menu Prueba</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style3 {font-family: Verdana, Arial, Helvetica, sans-serif; color: #993333; }
-->
</style>
</head>
<%
Dim strDataPath, strConnectString, objConnection
Dim strSistema, strEquipo, strElemento, objRS, strSelected, strSQL
strSistema = Request.Form("Sistema")
strEquipo = Request.Form("Equipo")
strElemento = Request.Form("Elemento")
'set connection strings for entire application
strDataPath = Server.MapPath("analisis.m
strConnectString = "Provider=Microsoft.Jet.OL
+ " Data Source= " & strDataPath & ";"
If Not IsObject("ojbConnection") Then
Set objConnection=Server.Creat
objConnection.ConnectionTi
objConnection.CommandTimeo
objConnection.Mode = 3 'adModeReadWrite
If objConnection.state = 0 Then
objConnection.Open strConnectString
End If
End If
%>
<%
Sub makeSistema()
If Not IsObject("objRS") Then
Set objRS=Server.CreateObject(
End If
If objRS.state <> 0 Then
objRS.close
End If
strSQL = "SELECT Sis_Codi FROM Sistemas"
objRS.Open strSQL,objConnection,3,3
Response.Write("<option></
Do While Not objRS.EOF
If objRS("Sis_Codi") = strSistema Then
strSelected = " Selected "
Else
strSelected = ""
End If
Response.Write("<option" & strSelected & ">" &_
objRS("Sis_Codi") & "</option>" & vbCrLf )
objRS.MoveNext
Loop
objRS.Close
Set objRS=Nothing
End Sub
%>
<%
Sub makeEquipo()
If strSistema <> "" Then
If Not IsObject("objRS") Then
Set objRS=Server.CreateObject(
End If
If objRS.state <> 0 Then
objRS.close
End If
strSQL ="SELECT Equ_Codi FROM Equipos WHERE Sis_Codi = '" &_
strSistema & "' ORDER BY Equ_Codi"
objRS.Open strSQL,objConnection,3,3
If objRS.eof Then
Response.Write("<option>No
Else
Response.Write("<option>Se
Do While Not objRS.EOF
If objRS("Equ_Codi") = strEquipo Then
strSelected = " Selected "
Else
strSelected = ""
End If
Response.Write("<option" & strSelected & ">" &_
objRS("Equ_Codi") & "</option>" & vbCrLf )
objRS.MoveNext
Loop
End If
objRS.Close
Set objRS=Nothing
Else
Response.Write("<option>Se
End If
End Sub
Sub makeElemento()
If strEquipo <> "Seleccione un Sistema Primero" And _
strEquipo <> "Seleccione un Elemento Ahora" And strEquipo <>"" Then
If Not IsObject("objRS") Then
Set objRS=Server.CreateObject(
End If
If objRS.state <> 0 Then
objRS.close
End If
strSQL = "SELECT Equ_Desc FROM Equipos WHERE Equ_Codi = '" &_
strEquipo & "' ORDER BY Equ_Codi"
objRS.Open strSQL,objConnection,3,3
If objRS.eof Then
Response.Write("<option>No
Else
Response.Write("<option>Se
Do While Not objRS.EOF
If objRS("Equ_Desc") = strElemento Then
strSelected = " Selected "
Else
strSelected = ""
End If
Response.Write("<option" & strSelected & ">" &_
objRS("Equ_Desc") & "</option>" & vbCrLf )
objRS.MoveNext
Loop
End If
objRS.Close
Set objRS=Nothing
Else
Response.Write("<option>Se
End If
End Sub
%>
<SCRIPT LANGUAGE=javascript>
<!--
Function submitSistema(){
var objForm = document.forms[0];
objForm.elements['Equipo']
objForm.elements['Elemento
objForm.submit();
}
Function submitEquipo(){
var objForm = document.forms[0];
objForm.elements['Elemento
objForm.submit();
}
//-->
</SCRIPT>
<SCRIPT LANGUAGE=javascript>
<!--
Function submitForm(){
var objForm = document.forms[0];
objForm.action = "http://localhost/mantenimiento/Test/menustest.asp"
return true;
}
//-->
</SCRIPT>
<body>
<FORM action="" method=POST id=form1 name=form1 onSubmit="return submitForm()">
<table width="80%" border="0">
<tr>
<td width="44%"><span class="style3">Sistema</sp
<td width="56%"><select name="Sistema" onChange="submitSistema()"
<%call makeSistema%>
</select>
<input type="submit" value="OK" id=submit12 name=submit1></td>
</tr>
<tr>
<td><span class="style3">Equipos</sp
<td><select name="Equipo" onChange="submitEquipo()">
<%call makeEquipo%>
</select>
<input type="submit" value="OK" id=submit1 name=submit12></td>
</tr>
<tr>
<td><span class="style3">Elementos a Gráficar </span></td>
<td><select name="Elemento">
<%call makeElemento%>
</select>
<input type="submit" value="OK" id=submit13 name=submit13></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
</FORM>
</BODY>
<%
objConnection.Close
Set objConnection = Nothing
%>
</html>
Thank you for your help!
Check it by looking here when drilling down countries
http://www.macanthonyrealtyproperties.com/properties/search.asp
http://www.macanthonyrealtyproperties.com/properties/search.asp
Try this... It's not tested against database though!
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%Option Explicit%>
<%Response.Buffer = True%>
<html>
<head>
<title>Menu Prueba</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style3 {font-family: Verdana, Arial, Helvetica, sans-serif; color: #993333; }
-->
</style>
</head>
<%
Dim strDataPath, strConnectString, objConnection
Dim strSistema, strEquipo, strElemento, objRS, strSelected, strSQL
strSistema = Request.Form("Sistema")
strEquipo = Request.Form("Equipo")
strElemento = Request.Form("Elemento")
src= = Request.Form("cmbsrc")
select case src
case "1"
strEquipo=""
strElemento =""
case "2"
strElemento =""
end select
'set connection strings for entire application
strDataPath = Server.MapPath("analisis.m db")
strConnectString = "Provider=Microsoft.Jet.OL EDB.4.0;"_
+ " Data Source= " & strDataPath & ";"
If Not IsObject("ojbConnection") Then
Set objConnection=Server.Creat eObject("A DODB.Conne ction")
objConnection.ConnectionTi meout = 15
objConnection.CommandTimeo ut = 10
objConnection.Mode = 3 'adModeReadWrite
If objConnection.state = 0 Then
objConnection.Open strConnectString
End If
End If
%>
<%
Sub makeSistema()
If Not IsObject("objRS") Then
Set objRS=Server.CreateObject( "ADODB.Rec ordSet")
End If
If objRS.state <> 0 Then
objRS.close
End If
strSQL = "SELECT Sis_Codi FROM Sistemas"
objRS.Open strSQL,objConnection,3,3
Response.Write("<option></ option>" & vbCrLf )
Do While Not objRS.EOF
If objRS("Sis_Codi") = strSistema Then
strSelected = " Selected "
Else
strSelected = ""
End If
Response.Write("<option" & strSelected & ">" &_
objRS("Sis_Codi") & "</option>" & vbCrLf )
objRS.MoveNext
Loop
objRS.Close
Set objRS=Nothing
End Sub
%>
<%
Sub makeEquipo()
If strSistema <> "" Then
If Not IsObject("objRS") Then
Set objRS=Server.CreateObject( "ADODB.Rec ordSet")
End If
If objRS.state <> 0 Then
objRS.close
End If
strSQL ="SELECT Equ_Codi FROM Equipos "
if(strSistema<>"") then strsQl= strsql & " WHERE Sis_Codi = '" & strSistema & "'"
strsql =strsql & " ORDER BY Equ_Codi"
objRS.Open strSQL,objConnection,3,3
If objRS.eof Then
Response.Write("<option>No Se Encontraron Equipos</option>")
Else
Response.Write("<option>Se leccione un Equipo Ahora</option>" & vbCrLf )
Do While Not objRS.EOF
If objRS("Equ_Codi") = strEquipo Then
strSelected = " Selected "
Else
strSelected = ""
End If
Response.Write("<option" & strSelected & ">" &_
objRS("Equ_Codi") & "</option>" & vbCrLf )
objRS.MoveNext
Loop
End If
objRS.Close
Set objRS=Nothing
Else
Response.Write("<option>Se leccione un Equipo Primero </option>")
End If
End Sub
Sub makeElemento()
If strEquipo <> "Seleccione un Sistema Primero" And _
strEquipo <> "Seleccione un Elemento Ahora" And strEquipo <>"" Then
If Not IsObject("objRS") Then
Set objRS=Server.CreateObject( "ADODB.Rec ordSet")
End If
If objRS.state <> 0 Then
objRS.close
End If
strSQL = "SELECT Equ_Desc FROM Equipos "
if(strEquipo<>"") then strsql =strsql & " WHERE Equ_Codi = '" & strEquipo & "'"
strsql =strsql & " ORDER BY Equ_Codi"
objRS.Open strSQL,objConnection,3,3
If objRS.eof Then
Response.Write("<option>No Descriptions Found</option>")
Else
Response.Write("<option>Se lect Description Now</option>" & vbCrLf )
Do While Not objRS.EOF
If objRS("Equ_Desc") = strElemento Then
strSelected = " Selected "
Else
strSelected = ""
End If
Response.Write("<option" & strSelected & ">" &_
objRS("Equ_Desc") & "</option>" & vbCrLf )
objRS.MoveNext
Loop
End If
objRS.Close
Set objRS=Nothing
Else
Response.Write("<option>Se lect a Region First</option>")
End If
End Sub
%>
<SCRIPT LANGUAGE=javascript>
<!--
Function submitSistema(){
var objForm = document.forms[0];
objForm.elements['Equipo'] .selectedI ndex=0;
objForm.elements['Elemento '].selecte dIndex = 0;
document.theform.cmbsrc.va lue= 1;
objForm.submit();
}
Function submitEquipo(){
var objForm = document.forms[0];
objForm.elements['Elemento '].selecte dIndex = 0;
document.theform.cmbsrc.va lue= 2;
objForm.submit();
}
//-->
</SCRIPT>
<SCRIPT LANGUAGE=javascript>
<!--
Function submitForm(){
var objForm = document.forms[0];
objForm.action = "http://localhost/mantenimiento/Test/menustest.asp"
return true;
}
//-->
</SCRIPT>
<body>
<FORM action="" method=POST id=form1 name=form1 onSubmit="return submitForm()">
<input type="hidden" value="1" name="cmbsrc">
<table width="80%" border="0">
<tr>
<td width="44%"><span class="style3">Sistema</sp an></td>
<td width="56%"><select name="Sistema" onChange="submitSistema()" >
<%call makeSistema%>
</select>
<input type="submit" value="OK" id=submit12 name=submit1></td>
</tr>
<tr>
<td><span class="style3">Equipos</sp an></td>
<td><select name="Equipo" onChange="submitEquipo()">
<%call makeEquipo%>
</select>
<input type="submit" value="OK" id=submit1 name=submit12></td>
</tr>
<tr>
<td><span class="style3">Elementos a Gráficar </span></td>
<td><select name="Elemento">
<%call makeElemento%>
</select>
<input type="submit" value="OK" id=submit13 name=submit13></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
</FORM>
</BODY>
<%
objConnection.Close
Set objConnection = Nothing
%>
</html>
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%Option Explicit%>
<%Response.Buffer = True%>
<html>
<head>
<title>Menu Prueba</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style3 {font-family: Verdana, Arial, Helvetica, sans-serif; color: #993333; }
-->
</style>
</head>
<%
Dim strDataPath, strConnectString, objConnection
Dim strSistema, strEquipo, strElemento, objRS, strSelected, strSQL
strSistema = Request.Form("Sistema")
strEquipo = Request.Form("Equipo")
strElemento = Request.Form("Elemento")
src= = Request.Form("cmbsrc")
select case src
case "1"
strEquipo=""
strElemento =""
case "2"
strElemento =""
end select
'set connection strings for entire application
strDataPath = Server.MapPath("analisis.m
strConnectString = "Provider=Microsoft.Jet.OL
+ " Data Source= " & strDataPath & ";"
If Not IsObject("ojbConnection") Then
Set objConnection=Server.Creat
objConnection.ConnectionTi
objConnection.CommandTimeo
objConnection.Mode = 3 'adModeReadWrite
If objConnection.state = 0 Then
objConnection.Open strConnectString
End If
End If
%>
<%
Sub makeSistema()
If Not IsObject("objRS") Then
Set objRS=Server.CreateObject(
End If
If objRS.state <> 0 Then
objRS.close
End If
strSQL = "SELECT Sis_Codi FROM Sistemas"
objRS.Open strSQL,objConnection,3,3
Response.Write("<option></
Do While Not objRS.EOF
If objRS("Sis_Codi") = strSistema Then
strSelected = " Selected "
Else
strSelected = ""
End If
Response.Write("<option" & strSelected & ">" &_
objRS("Sis_Codi") & "</option>" & vbCrLf )
objRS.MoveNext
Loop
objRS.Close
Set objRS=Nothing
End Sub
%>
<%
Sub makeEquipo()
If strSistema <> "" Then
If Not IsObject("objRS") Then
Set objRS=Server.CreateObject(
End If
If objRS.state <> 0 Then
objRS.close
End If
strSQL ="SELECT Equ_Codi FROM Equipos "
if(strSistema<>"") then strsQl= strsql & " WHERE Sis_Codi = '" & strSistema & "'"
strsql =strsql & " ORDER BY Equ_Codi"
objRS.Open strSQL,objConnection,3,3
If objRS.eof Then
Response.Write("<option>No
Else
Response.Write("<option>Se
Do While Not objRS.EOF
If objRS("Equ_Codi") = strEquipo Then
strSelected = " Selected "
Else
strSelected = ""
End If
Response.Write("<option" & strSelected & ">" &_
objRS("Equ_Codi") & "</option>" & vbCrLf )
objRS.MoveNext
Loop
End If
objRS.Close
Set objRS=Nothing
Else
Response.Write("<option>Se
End If
End Sub
Sub makeElemento()
If strEquipo <> "Seleccione un Sistema Primero" And _
strEquipo <> "Seleccione un Elemento Ahora" And strEquipo <>"" Then
If Not IsObject("objRS") Then
Set objRS=Server.CreateObject(
End If
If objRS.state <> 0 Then
objRS.close
End If
strSQL = "SELECT Equ_Desc FROM Equipos "
if(strEquipo<>"") then strsql =strsql & " WHERE Equ_Codi = '" & strEquipo & "'"
strsql =strsql & " ORDER BY Equ_Codi"
objRS.Open strSQL,objConnection,3,3
If objRS.eof Then
Response.Write("<option>No
Else
Response.Write("<option>Se
Do While Not objRS.EOF
If objRS("Equ_Desc") = strElemento Then
strSelected = " Selected "
Else
strSelected = ""
End If
Response.Write("<option" & strSelected & ">" &_
objRS("Equ_Desc") & "</option>" & vbCrLf )
objRS.MoveNext
Loop
End If
objRS.Close
Set objRS=Nothing
Else
Response.Write("<option>Se
End If
End Sub
%>
<SCRIPT LANGUAGE=javascript>
<!--
Function submitSistema(){
var objForm = document.forms[0];
objForm.elements['Equipo']
objForm.elements['Elemento
document.theform.cmbsrc.va
objForm.submit();
}
Function submitEquipo(){
var objForm = document.forms[0];
objForm.elements['Elemento
document.theform.cmbsrc.va
objForm.submit();
}
//-->
</SCRIPT>
<SCRIPT LANGUAGE=javascript>
<!--
Function submitForm(){
var objForm = document.forms[0];
objForm.action = "http://localhost/mantenimiento/Test/menustest.asp"
return true;
}
//-->
</SCRIPT>
<body>
<FORM action="" method=POST id=form1 name=form1 onSubmit="return submitForm()">
<input type="hidden" value="1" name="cmbsrc">
<table width="80%" border="0">
<tr>
<td width="44%"><span class="style3">Sistema</sp
<td width="56%"><select name="Sistema" onChange="submitSistema()"
<%call makeSistema%>
</select>
<input type="submit" value="OK" id=submit12 name=submit1></td>
</tr>
<tr>
<td><span class="style3">Equipos</sp
<td><select name="Equipo" onChange="submitEquipo()">
<%call makeEquipo%>
</select>
<input type="submit" value="OK" id=submit1 name=submit12></td>
</tr>
<tr>
<td><span class="style3">Elementos a Gráficar </span></td>
<td><select name="Elemento">
<%call makeElemento%>
</select>
<input type="submit" value="OK" id=submit13 name=submit13></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
</FORM>
</BODY>
<%
objConnection.Close
Set objConnection = Nothing
%>
</html>
YOu don't need to have the submit buttons--the onChange() event of the select takes care of that. Please re-read my code:
<%@ Language = VBScript %>
<%Option Explicit%>
<%Response.Buffer = True%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
<%
dim strDataPath, strConnectString, objConnection, strCountry, strRegion, strCity, objRS, strSelected
strCountry = Request.Form("Country")
strRegion = Request.Form("Region")
strCity = Request.Form("City")
'set connection strings for entire application
strDataPath = server.MapPath("NorthWind. mdb")
strConnectString = "Provider=Microsoft.Jet.OL EDB.4.0;Us er ID=Admin;"_
+ " Data Source= " & strDataPath & ";"_
+ " Mode=Share Deny None;User Id=admin;PASSWORD=;"
if not IsObject("ojbConnection") then
set objConnection=Server.Creat eObject("A DODB.Conne ction")
objConnection.ConnectionTi meout = 15
objConnection.CommandTimeo ut = 10
objConnection.Mode = 3 'adModeReadWrite
if objConnection.state = 0 then
objConnection.Open strConnectString
end if
end if
sub makeCountry()
if not isObject("objRS") then
set objRS=Server.CreateObject( "ADODB.Rec ordSet")
end if
if objRS.state <> 0 then
objRS.close
end if
objRS.Open "SELECT DISTINCT Country FROM Customers ORDER BY Country",objConnection,3,3
Response.Write("<option></ option>" & VBCRLF )
do while not objRS.EOF
if objRS("Country") = strCountry then
strSelected = " Selected "
else
strSelected = ""
end if
Response.Write("<option" & strSelected & ">" & objRS("Country") & "</option>" & VBCRLF )
objRS.MoveNext
loop
objRS.Close
set objRS=Nothing
end sub
sub makeRegion()
if strCountry <> "" then
if not isObject("objRS") then
set objRS=Server.CreateObject( "ADODB.Rec ordSet")
end if
if objRS.state <> 0 then
objRS.close
end if
objRS.Open "SELECT DISTINCT Region FROM Customers WHERE Country = '" & strCountry & "' ORDER BY Region",objConnection,3,3
if objRS.eof then
Response.Write("<option>No Regions Found</option>")
else
Response.Write("<option>Se lect Region Now</option>" & VBCRLF )
do while not objRS.EOF
if objRS("Region") = strRegion then
strSelected = " Selected "
else
strSelected = ""
end if
Response.Write("<option" & strSelected & ">" & objRS("Region") & "</option>" & VBCRLF )
objRS.MoveNext
loop
end if
objRS.Close
set objRS=Nothing
else
Response.Write("<option>Se lect a Country First</option>")
end if
end sub
sub makeCity()
if strRegion <> "Select a Country First" AND strRegion <> "Select Region Now" AND strRegion <>"" then
if not isObject("objRS") then
set objRS=Server.CreateObject( "ADODB.Rec ordSet")
end if
if objRS.state <> 0 then
objRS.close
end if
objRS.Open "SELECT DISTINCT City FROM Customers WHERE Region = '" & strRegion & "' ORDER BY City",objConnection,3,3
if objRS.eof then
Response.Write("<option>No Cities Found</option>")
else
Response.Write("<option>Se lect City Now</option>" & VBCRLF )
do while not objRS.EOF
if objRS("City") = strCity then
strSelected = " Selected "
else
strSelected = ""
end if
Response.Write("<option" & strSelected & ">" & objRS("City") & "</option>" & VBCRLF )
objRS.MoveNext
loop
end if
objRS.Close
set objRS=Nothing
else
Response.Write("<option>Se lect a Region First</option>")
end if
end sub
%>
<SCRIPT LANGUAGE=javascript>
<!--
function submitCountry(){
var objForm = document.forms[0];
objForm.elements['Region'] .selectedI ndex=0;
objForm.elements['City'].s electedInd ex = 0;
objForm.submit();
}
function submitRegion(){
var objForm = document.forms[0];
objForm.elements['City'].s electedInd ex = 0;
objForm.submit();
}
function submitForm(){
var objForm = document.forms[0];
objForm.action = "http://www.FairfieldConsulting.com/processform.asp"
return true;
}
//-->
</SCRIPT>
</HEAD>
<BODY>
<FORM action="" method=POST id=form1 name=form1 onSubmit="return submitForm()">
<SELECT name="Country" onChange="submitCountry()" >
<%call makeCountry%>
</SELECT><br>
<SELECT name="Region" onChange="submitRegion()">
<%call makeRegion%>
</SELECT><br>
<SELECT name="City">
<%call makeCity%>
</SELECT><br>
<p><INPUT type="submit" value="Submit" id=submit1 name=submit1></p>
</FORM>
</BODY>
<%
objConnection.Close
set objConnection = Nothing
%>
</HTML>
FtB
<%@ Language = VBScript %>
<%Option Explicit%>
<%Response.Buffer = True%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
<%
dim strDataPath, strConnectString, objConnection, strCountry, strRegion, strCity, objRS, strSelected
strCountry = Request.Form("Country")
strRegion = Request.Form("Region")
strCity = Request.Form("City")
'set connection strings for entire application
strDataPath = server.MapPath("NorthWind.
strConnectString = "Provider=Microsoft.Jet.OL
+ " Data Source= " & strDataPath & ";"_
+ " Mode=Share Deny None;User Id=admin;PASSWORD=;"
if not IsObject("ojbConnection") then
set objConnection=Server.Creat
objConnection.ConnectionTi
objConnection.CommandTimeo
objConnection.Mode = 3 'adModeReadWrite
if objConnection.state = 0 then
objConnection.Open strConnectString
end if
end if
sub makeCountry()
if not isObject("objRS") then
set objRS=Server.CreateObject(
end if
if objRS.state <> 0 then
objRS.close
end if
objRS.Open "SELECT DISTINCT Country FROM Customers ORDER BY Country",objConnection,3,3
Response.Write("<option></
do while not objRS.EOF
if objRS("Country") = strCountry then
strSelected = " Selected "
else
strSelected = ""
end if
Response.Write("<option" & strSelected & ">" & objRS("Country") & "</option>" & VBCRLF )
objRS.MoveNext
loop
objRS.Close
set objRS=Nothing
end sub
sub makeRegion()
if strCountry <> "" then
if not isObject("objRS") then
set objRS=Server.CreateObject(
end if
if objRS.state <> 0 then
objRS.close
end if
objRS.Open "SELECT DISTINCT Region FROM Customers WHERE Country = '" & strCountry & "' ORDER BY Region",objConnection,3,3
if objRS.eof then
Response.Write("<option>No
else
Response.Write("<option>Se
do while not objRS.EOF
if objRS("Region") = strRegion then
strSelected = " Selected "
else
strSelected = ""
end if
Response.Write("<option" & strSelected & ">" & objRS("Region") & "</option>" & VBCRLF )
objRS.MoveNext
loop
end if
objRS.Close
set objRS=Nothing
else
Response.Write("<option>Se
end if
end sub
sub makeCity()
if strRegion <> "Select a Country First" AND strRegion <> "Select Region Now" AND strRegion <>"" then
if not isObject("objRS") then
set objRS=Server.CreateObject(
end if
if objRS.state <> 0 then
objRS.close
end if
objRS.Open "SELECT DISTINCT City FROM Customers WHERE Region = '" & strRegion & "' ORDER BY City",objConnection,3,3
if objRS.eof then
Response.Write("<option>No
else
Response.Write("<option>Se
do while not objRS.EOF
if objRS("City") = strCity then
strSelected = " Selected "
else
strSelected = ""
end if
Response.Write("<option" & strSelected & ">" & objRS("City") & "</option>" & VBCRLF )
objRS.MoveNext
loop
end if
objRS.Close
set objRS=Nothing
else
Response.Write("<option>Se
end if
end sub
%>
<SCRIPT LANGUAGE=javascript>
<!--
function submitCountry(){
var objForm = document.forms[0];
objForm.elements['Region']
objForm.elements['City'].s
objForm.submit();
}
function submitRegion(){
var objForm = document.forms[0];
objForm.elements['City'].s
objForm.submit();
}
function submitForm(){
var objForm = document.forms[0];
objForm.action = "http://www.FairfieldConsulting.com/processform.asp"
return true;
}
//-->
</SCRIPT>
</HEAD>
<BODY>
<FORM action="" method=POST id=form1 name=form1 onSubmit="return submitForm()">
<SELECT name="Country" onChange="submitCountry()"
<%call makeCountry%>
</SELECT><br>
<SELECT name="Region" onChange="submitRegion()">
<%call makeRegion%>
</SELECT><br>
<SELECT name="City">
<%call makeCity%>
</SELECT><br>
<p><INPUT type="submit" value="Submit" id=submit1 name=submit1></p>
</FORM>
</BODY>
<%
objConnection.Close
set objConnection = Nothing
%>
</HTML>
FtB
ASKER
Hi Fritz_the_blank
I´ve tried, your code, but the menus don´t change until I click the submit button
I´ve tried, your code, but the menus don´t change until I click the submit button
Make sure that you are actually changing the selection. Not just clicking the combo box.
For example
if you have 3 choices Choice1,Choice2,Choice3. Combo box is SHOWING Choice1.
If you click on combo box & select choice1 again. Event will not fire & form is not submitted.
If you click on combo box & select any other choice. Event WILL fire & form WILL get submitted.
The code I posted above, also handles combo loading logic (selection) & reset of combo boxes when user changes first combo box after navigating to third combo.
For example
if you have 3 choices Choice1,Choice2,Choice3. Combo box is SHOWING Choice1.
If you click on combo box & select choice1 again. Event will not fire & form is not submitted.
If you click on combo box & select any other choice. Event WILL fire & form WILL get submitted.
The code I posted above, also handles combo loading logic (selection) & reset of combo boxes when user changes first combo box after navigating to third combo.
ASKER
Shailesh15
I´m getting an error, where do I define the form "cmbsrc"
sintaxis error
/mantenimiento/Test/menust est2.asp, line 20, column 5
src= = Request.Form("cmbsrc")
----^
I´m getting an error, where do I define the form "cmbsrc"
sintaxis error
/mantenimiento/Test/menust
src= = Request.Form("cmbsrc")
----^
change
src= = Request.Form("cmbsrc")
to
src = Request.Form("cmbsrc")
there is a extra =.
cmbsrc is a hidden field just below form tag
src= = Request.Form("cmbsrc")
to
src = Request.Form("cmbsrc")
there is a extra =.
cmbsrc is a hidden field just below form tag
ASKER
This is what I have, but still I have to click the ok to change the other menues, plus now the third one is not showing up
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%Option Explicit%>
<%Response.Buffer = True%>
<html>
<head>
<title>Menu Prueba</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style3 {font-family: Verdana, Arial, Helvetica, sans-serif; color: #993333; }
-->
</style>
</head>
<%
Dim strDataPath, strConnectString, objConnection
Dim strSistema, strEquipo, strElemento, objRS, strSelected, strSQL, src
strSistema = Request.Form("Sistema")
strEquipo = Request.Form("Equipo")
strElemento = Request.Form("Elemento")
src = Request.Form("cmbsrc")
select case src
case "1"
strEquipo=""
strElemento =""
case "2"
strElemento =""
end select
'set connection strings for entire application
strDataPath = Server.MapPath("analisis.m db")
strConnectString = "Provider=Microsoft.Jet.OL EDB.4.0;"_
+ " Data Source= " & strDataPath & ";"
If Not IsObject("ojbConnection") Then
Set objConnection=Server.Creat eObject("A DODB.Conne ction")
objConnection.ConnectionTi meout = 15
objConnection.CommandTimeo ut = 10
objConnection.Mode = 3 'adModeReadWrite
If objConnection.state = 0 Then
objConnection.Open strConnectString
End If
End If
%>
<%
Sub makeSistema()
If Not IsObject("objRS") Then
Set objRS=Server.CreateObject( "ADODB.Rec ordSet")
End If
If objRS.state <> 0 Then
objRS.close
End If
strSQL = "SELECT Sis_Codi FROM Sistemas"
objRS.Open strSQL,objConnection,3,3
Response.Write("<option></ option>" & vbCrLf )
Do While Not objRS.EOF
If objRS("Sis_Codi") = strSistema Then
strSelected = " Selected "
Else
strSelected = ""
End If
Response.Write("<option" & strSelected & ">" &_
objRS("Sis_Codi") & "</option>" & vbCrLf )
objRS.MoveNext
Loop
objRS.Close
Set objRS=Nothing
End Sub
%>
<%
Sub makeEquipo()
If strSistema <> "" Then
If Not IsObject("objRS") Then
Set objRS=Server.CreateObject( "ADODB.Rec ordSet")
End If
If objRS.state <> 0 Then
objRS.close
End If
strSQL ="SELECT Equ_Codi FROM Equipos "
if(strSistema<>"") then strsQl= strsql & " WHERE Sis_Codi = '" & strSistema & "'"
strsql =strsql & " ORDER BY Equ_Codi"
objRS.Open strSQL,objConnection,3,3
If objRS.eof Then
Response.Write("<option>No Se Encontraron Equipos</option>")
Else
Response.Write("<option>Se leccione un Equipo Ahora</option>" & vbCrLf )
Do While Not objRS.EOF
If objRS("Equ_Codi") = strEquipo Then
strSelected = " Selected "
Else
strSelected = ""
End If
Response.Write("<option" & strSelected & ">" &_
objRS("Equ_Codi") & "</option>" & vbCrLf )
objRS.MoveNext
Loop
End If
objRS.Close
Set objRS=Nothing
Else
Response.Write("<option>Se leccione un Equipo Primero </option>")
End If
End Sub
Sub makeElemento()
If strEquipo <> "Seleccione un Sistema Primero" And _
strEquipo <> "Seleccione un Elemento Ahora" And strEquipo <>"" Then
If Not IsObject("objRS") Then
Set objRS=Server.CreateObject( "ADODB.Rec ordSet")
End If
If objRS.state <> 0 Then
objRS.close
End If
strSQL = "SELECT Equ_Desc FROM Equipos "
if(strEquipo<>"") then strsql =strsql & " WHERE Equ_Codi = '" & strEquipo & "'"
strsql =strsql & " ORDER BY Equ_Codi"
objRS.Open strSQL,objConnection,3,3
If objRS.eof Then
Response.Write("<option>No Descriptions Found</option>")
Else
Response.Write("<option>Se lect Description Now</option>" & vbCrLf )
Do While Not objRS.EOF
If objRS("Equ_Desc") = strElemento Then
strSelected = " Selected "
Else
strSelected = ""
End If
Response.Write("<option" & strSelected & ">" &_
objRS("Equ_Desc") & "</option>" & vbCrLf )
objRS.MoveNext
Loop
End If
objRS.Close
Set objRS=Nothing
Else
Response.Write("<option>Se lect a Region First</option>")
End If
End Sub
%>
<SCRIPT LANGUAGE=javascript>
<!--
Function submitSistema(){
var objForm = document.forms[0];
objForm.elements['Equipo'] .selectedI ndex=0;
objForm.elements['Elemento '].selecte dIndex = 0;
document.theform.cmbsrc.va lue= 1;
objForm.submit();
}
Function submitEquipo(){
var objForm = document.forms[0];
objForm.elements['Elemento '].selecte dIndex = 0;
document.theform.cmbsrc.va lue= 2;
objForm.submit();
}
//-->
</SCRIPT>
<SCRIPT LANGUAGE=javascript>
<!--
Function submitForm(){
var objForm = document.forms[0];
objForm.action = "http://localhost/mantenimiento/Test/menustest.asp"
return true;
}
//-->
</SCRIPT>
<body>
<FORM action="" method=POST id=form1 name=form1 onSubmit="return submitForm()">
<input type="hidden" value="1" name="cmbsrc">
<table width="80%" border="0">
<tr>
<td width="44%"><span class="style3">Sistema</sp an></td>
<td width="56%"><select name="Sistema" onChange="submitSistema()" >
<%call makeSistema%>
</select>
</td>
</tr>
<tr>
<td><span class="style3">Equipos</sp an></td>
<td><select name="Equipo" onChange="submitEquipo()">
<%call makeEquipo%>
</select>
</td>
</tr>
<tr>
<td><span class="style3">Elementos a Gráficar </span></td>
<td><select name="Elemento">
<%call makeElemento%>
</select>
</td>
</tr>
<tr>
<td> </td>
<td><input type="submit" value="OK" id=submit13 name=submit13></td>
</tr>
</table>
</FORM>
</BODY>
<%
objConnection.Close
Set objConnection = Nothing
%>
</html>
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%Option Explicit%>
<%Response.Buffer = True%>
<html>
<head>
<title>Menu Prueba</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style3 {font-family: Verdana, Arial, Helvetica, sans-serif; color: #993333; }
-->
</style>
</head>
<%
Dim strDataPath, strConnectString, objConnection
Dim strSistema, strEquipo, strElemento, objRS, strSelected, strSQL, src
strSistema = Request.Form("Sistema")
strEquipo = Request.Form("Equipo")
strElemento = Request.Form("Elemento")
src = Request.Form("cmbsrc")
select case src
case "1"
strEquipo=""
strElemento =""
case "2"
strElemento =""
end select
'set connection strings for entire application
strDataPath = Server.MapPath("analisis.m
strConnectString = "Provider=Microsoft.Jet.OL
+ " Data Source= " & strDataPath & ";"
If Not IsObject("ojbConnection") Then
Set objConnection=Server.Creat
objConnection.ConnectionTi
objConnection.CommandTimeo
objConnection.Mode = 3 'adModeReadWrite
If objConnection.state = 0 Then
objConnection.Open strConnectString
End If
End If
%>
<%
Sub makeSistema()
If Not IsObject("objRS") Then
Set objRS=Server.CreateObject(
End If
If objRS.state <> 0 Then
objRS.close
End If
strSQL = "SELECT Sis_Codi FROM Sistemas"
objRS.Open strSQL,objConnection,3,3
Response.Write("<option></
Do While Not objRS.EOF
If objRS("Sis_Codi") = strSistema Then
strSelected = " Selected "
Else
strSelected = ""
End If
Response.Write("<option" & strSelected & ">" &_
objRS("Sis_Codi") & "</option>" & vbCrLf )
objRS.MoveNext
Loop
objRS.Close
Set objRS=Nothing
End Sub
%>
<%
Sub makeEquipo()
If strSistema <> "" Then
If Not IsObject("objRS") Then
Set objRS=Server.CreateObject(
End If
If objRS.state <> 0 Then
objRS.close
End If
strSQL ="SELECT Equ_Codi FROM Equipos "
if(strSistema<>"") then strsQl= strsql & " WHERE Sis_Codi = '" & strSistema & "'"
strsql =strsql & " ORDER BY Equ_Codi"
objRS.Open strSQL,objConnection,3,3
If objRS.eof Then
Response.Write("<option>No
Else
Response.Write("<option>Se
Do While Not objRS.EOF
If objRS("Equ_Codi") = strEquipo Then
strSelected = " Selected "
Else
strSelected = ""
End If
Response.Write("<option" & strSelected & ">" &_
objRS("Equ_Codi") & "</option>" & vbCrLf )
objRS.MoveNext
Loop
End If
objRS.Close
Set objRS=Nothing
Else
Response.Write("<option>Se
End If
End Sub
Sub makeElemento()
If strEquipo <> "Seleccione un Sistema Primero" And _
strEquipo <> "Seleccione un Elemento Ahora" And strEquipo <>"" Then
If Not IsObject("objRS") Then
Set objRS=Server.CreateObject(
End If
If objRS.state <> 0 Then
objRS.close
End If
strSQL = "SELECT Equ_Desc FROM Equipos "
if(strEquipo<>"") then strsql =strsql & " WHERE Equ_Codi = '" & strEquipo & "'"
strsql =strsql & " ORDER BY Equ_Codi"
objRS.Open strSQL,objConnection,3,3
If objRS.eof Then
Response.Write("<option>No
Else
Response.Write("<option>Se
Do While Not objRS.EOF
If objRS("Equ_Desc") = strElemento Then
strSelected = " Selected "
Else
strSelected = ""
End If
Response.Write("<option" & strSelected & ">" &_
objRS("Equ_Desc") & "</option>" & vbCrLf )
objRS.MoveNext
Loop
End If
objRS.Close
Set objRS=Nothing
Else
Response.Write("<option>Se
End If
End Sub
%>
<SCRIPT LANGUAGE=javascript>
<!--
Function submitSistema(){
var objForm = document.forms[0];
objForm.elements['Equipo']
objForm.elements['Elemento
document.theform.cmbsrc.va
objForm.submit();
}
Function submitEquipo(){
var objForm = document.forms[0];
objForm.elements['Elemento
document.theform.cmbsrc.va
objForm.submit();
}
//-->
</SCRIPT>
<SCRIPT LANGUAGE=javascript>
<!--
Function submitForm(){
var objForm = document.forms[0];
objForm.action = "http://localhost/mantenimiento/Test/menustest.asp"
return true;
}
//-->
</SCRIPT>
<body>
<FORM action="" method=POST id=form1 name=form1 onSubmit="return submitForm()">
<input type="hidden" value="1" name="cmbsrc">
<table width="80%" border="0">
<tr>
<td width="44%"><span class="style3">Sistema</sp
<td width="56%"><select name="Sistema" onChange="submitSistema()"
<%call makeSistema%>
</select>
</td>
</tr>
<tr>
<td><span class="style3">Equipos</sp
<td><select name="Equipo" onChange="submitEquipo()">
<%call makeEquipo%>
</select>
</td>
</tr>
<tr>
<td><span class="style3">Elementos a Gráficar </span></td>
<td><select name="Elemento">
<%call makeElemento%>
</select>
</td>
</tr>
<tr>
<td> </td>
<td><input type="submit" value="OK" id=submit13 name=submit13></td>
</tr>
</table>
</FORM>
</BODY>
<%
objConnection.Close
Set objConnection = Nothing
%>
</html>
Try this.. I not not sure about 3rd combobox though.
Are you sure it has nothing to do with your check
" If strEquipo <> "Seleccione un Sistema Primero" And _
strEquipo <> "Seleccione un Elemento Ahora" And strEquipo <>"" Then" ?.
************************** **********
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%Option Explicit%>
<%Response.Buffer = True%>
<html>
<head>
<title>Menu Prueba</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style3 {font-family: Verdana, Arial, Helvetica, sans-serif; color: #993333; }
-->
</style>
</head>
<%
Dim strDataPath, strConnectString, objConnection
Dim strSistema, strEquipo, strElemento, objRS, strSelected, strSQL, src
strSistema = Request.Form("Sistema")
strEquipo = Request.Form("Equipo")
strElemento = Request.Form("Elemento")
src = Request.Form("cmbsrc")
select case src
case "1"
strEquipo=""
strElemento =""
case "2"
strElemento =""
end select
'set connection strings for entire application
strDataPath = Server.MapPath("analisis.m db")
strConnectString = "Provider=Microsoft.Jet.OL EDB.4.0;"_
+ " Data Source= " & strDataPath & ";"
If Not IsObject("ojbConnection") Then
Set objConnection=Server.Creat eObject("A DODB.Conne ction")
objConnection.ConnectionTi meout = 15
objConnection.CommandTimeo ut = 10
objConnection.Mode = 3 'adModeReadWrite
If objConnection.state = 0 Then
objConnection.Open strConnectString
End If
End If
%>
<%
Sub makeSistema()
If Not IsObject("objRS") Then
Set objRS=Server.CreateObject( "ADODB.Rec ordSet")
End If
If objRS.state <> 0 Then
objRS.close
End If
strSQL = "SELECT Sis_Codi FROM Sistemas"
objRS.Open strSQL,objConnection,3,3
Response.Write("<option></ option>" & vbCrLf )
Do While Not objRS.EOF
If objRS("Sis_Codi") = strSistema Then
strSelected = " Selected "
Else
strSelected = ""
End If
Response.Write("<option" & strSelected & ">" &_
objRS("Sis_Codi") & "</option>" & vbCrLf )
objRS.MoveNext
Loop
objRS.Close
Set objRS=Nothing
End Sub
%>
<%
Sub makeEquipo()
If strSistema <> "" Then
If Not IsObject("objRS") Then
Set objRS=Server.CreateObject( "ADODB.Rec ordSet")
End If
If objRS.state <> 0 Then
objRS.close
End If
strSQL ="SELECT Equ_Codi FROM Equipos "
if(strSistema<>"") then strsQl= strsql & " WHERE Sis_Codi = '" & strSistema & "'"
strsql =strsql & " ORDER BY Equ_Codi"
objRS.Open strSQL,objConnection,3,3
If objRS.eof Then
Response.Write("<option>No Se Encontraron Equipos</option>")
Else
Response.Write("<option>Se leccione un Equipo Ahora</option>" & vbCrLf )
Do While Not objRS.EOF
If objRS("Equ_Codi") = strEquipo Then
strSelected = " Selected "
Else
strSelected = ""
End If
Response.Write("<option" & strSelected & ">" &_
objRS("Equ_Codi") & "</option>" & vbCrLf )
objRS.MoveNext
Loop
End If
objRS.Close
Set objRS=Nothing
Else
Response.Write("<option>Se leccione un Equipo Primero </option>")
End If
End Sub
Sub makeElemento()
If strEquipo <> "Seleccione un Sistema Primero" And _
strEquipo <> "Seleccione un Elemento Ahora" And strEquipo <>"" Then
If Not IsObject("objRS") Then
Set objRS=Server.CreateObject( "ADODB.Rec ordSet")
End If
If objRS.state <> 0 Then
objRS.close
End If
strSQL = "SELECT Equ_Desc FROM Equipos "
if(strEquipo<>"") then strsql =strsql & " WHERE Equ_Codi = '" & strEquipo & "'"
strsql =strsql & " ORDER BY Equ_Codi"
objRS.Open strSQL,objConnection,3,3
If objRS.eof Then
Response.Write("<option>No Descriptions Found</option>")
Else
Response.Write("<option>Se lect Description Now</option>" & vbCrLf )
Do While Not objRS.EOF
If objRS("Equ_Desc") = strElemento Then
strSelected = " Selected "
Else
strSelected = ""
End If
Response.Write("<option" & strSelected & ">" &_
objRS("Equ_Desc") & "</option>" & vbCrLf )
objRS.MoveNext
Loop
End If
objRS.Close
Set objRS=Nothing
Else
Response.Write("<option>Se lect a Region First</option>")
End If
End Sub
%>
<SCRIPT LANGUAGE=javascript>
<!--
Function submitSistema(){
//var objForm = document.forms[0];
//objForm.elements['Equipo '].selecte dIndex=0;
//objForm.elements['Elemen to'].selec tedIndex = 0;
document.form1.cmbsrc.valu e= 1;
document.form1.submit();
}
Function submitEquipo(){
//var objForm = document.forms[0];
//objForm.elements['Elemen to'].selec tedIndex = 0;
document.form1.cmbsrc.valu e= 2;
document.form1.submit();
}
//-->
</SCRIPT>
<body>
<FORM action="http://localhost/mantenimiento/Test/menustest.asp" method=POST id=form1 name=form1>
<input type="hidden" value="1" name="cmbsrc">
<table width="80%" border="0">
<tr>
<td width="44%"><span class="style3">Sistema</sp an></td>
<td width="56%"><select name="Sistema" onChange="submitSistema()" >
<%call makeSistema%>
</select>
</td>
</tr>
<tr>
<td><span class="style3">Equipos</sp an></td>
<td><select name="Equipo" onChange="submitEquipo()">
<%call makeEquipo%>
</select>
</td>
</tr>
<tr>
<td><span class="style3">Elementos a Gráficar </span></td>
<td><select name="Elemento">
<%call makeElemento%>
</select>
</td>
</tr>
<tr>
<td> </td>
<td><input type="submit" value="OK" id=submit13 name=submit13></td>
</tr>
</table>
</FORM>
</BODY>
<%
objConnection.Close
Set objConnection = Nothing
%>
</html>
Are you sure it has nothing to do with your check
" If strEquipo <> "Seleccione un Sistema Primero" And _
strEquipo <> "Seleccione un Elemento Ahora" And strEquipo <>"" Then" ?.
**************************
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%Option Explicit%>
<%Response.Buffer = True%>
<html>
<head>
<title>Menu Prueba</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style3 {font-family: Verdana, Arial, Helvetica, sans-serif; color: #993333; }
-->
</style>
</head>
<%
Dim strDataPath, strConnectString, objConnection
Dim strSistema, strEquipo, strElemento, objRS, strSelected, strSQL, src
strSistema = Request.Form("Sistema")
strEquipo = Request.Form("Equipo")
strElemento = Request.Form("Elemento")
src = Request.Form("cmbsrc")
select case src
case "1"
strEquipo=""
strElemento =""
case "2"
strElemento =""
end select
'set connection strings for entire application
strDataPath = Server.MapPath("analisis.m
strConnectString = "Provider=Microsoft.Jet.OL
+ " Data Source= " & strDataPath & ";"
If Not IsObject("ojbConnection") Then
Set objConnection=Server.Creat
objConnection.ConnectionTi
objConnection.CommandTimeo
objConnection.Mode = 3 'adModeReadWrite
If objConnection.state = 0 Then
objConnection.Open strConnectString
End If
End If
%>
<%
Sub makeSistema()
If Not IsObject("objRS") Then
Set objRS=Server.CreateObject(
End If
If objRS.state <> 0 Then
objRS.close
End If
strSQL = "SELECT Sis_Codi FROM Sistemas"
objRS.Open strSQL,objConnection,3,3
Response.Write("<option></
Do While Not objRS.EOF
If objRS("Sis_Codi") = strSistema Then
strSelected = " Selected "
Else
strSelected = ""
End If
Response.Write("<option" & strSelected & ">" &_
objRS("Sis_Codi") & "</option>" & vbCrLf )
objRS.MoveNext
Loop
objRS.Close
Set objRS=Nothing
End Sub
%>
<%
Sub makeEquipo()
If strSistema <> "" Then
If Not IsObject("objRS") Then
Set objRS=Server.CreateObject(
End If
If objRS.state <> 0 Then
objRS.close
End If
strSQL ="SELECT Equ_Codi FROM Equipos "
if(strSistema<>"") then strsQl= strsql & " WHERE Sis_Codi = '" & strSistema & "'"
strsql =strsql & " ORDER BY Equ_Codi"
objRS.Open strSQL,objConnection,3,3
If objRS.eof Then
Response.Write("<option>No
Else
Response.Write("<option>Se
Do While Not objRS.EOF
If objRS("Equ_Codi") = strEquipo Then
strSelected = " Selected "
Else
strSelected = ""
End If
Response.Write("<option" & strSelected & ">" &_
objRS("Equ_Codi") & "</option>" & vbCrLf )
objRS.MoveNext
Loop
End If
objRS.Close
Set objRS=Nothing
Else
Response.Write("<option>Se
End If
End Sub
Sub makeElemento()
If strEquipo <> "Seleccione un Sistema Primero" And _
strEquipo <> "Seleccione un Elemento Ahora" And strEquipo <>"" Then
If Not IsObject("objRS") Then
Set objRS=Server.CreateObject(
End If
If objRS.state <> 0 Then
objRS.close
End If
strSQL = "SELECT Equ_Desc FROM Equipos "
if(strEquipo<>"") then strsql =strsql & " WHERE Equ_Codi = '" & strEquipo & "'"
strsql =strsql & " ORDER BY Equ_Codi"
objRS.Open strSQL,objConnection,3,3
If objRS.eof Then
Response.Write("<option>No
Else
Response.Write("<option>Se
Do While Not objRS.EOF
If objRS("Equ_Desc") = strElemento Then
strSelected = " Selected "
Else
strSelected = ""
End If
Response.Write("<option" & strSelected & ">" &_
objRS("Equ_Desc") & "</option>" & vbCrLf )
objRS.MoveNext
Loop
End If
objRS.Close
Set objRS=Nothing
Else
Response.Write("<option>Se
End If
End Sub
%>
<SCRIPT LANGUAGE=javascript>
<!--
Function submitSistema(){
//var objForm = document.forms[0];
//objForm.elements['Equipo
//objForm.elements['Elemen
document.form1.cmbsrc.valu
document.form1.submit();
}
Function submitEquipo(){
//var objForm = document.forms[0];
//objForm.elements['Elemen
document.form1.cmbsrc.valu
document.form1.submit();
}
//-->
</SCRIPT>
<body>
<FORM action="http://localhost/mantenimiento/Test/menustest.asp" method=POST id=form1 name=form1>
<input type="hidden" value="1" name="cmbsrc">
<table width="80%" border="0">
<tr>
<td width="44%"><span class="style3">Sistema</sp
<td width="56%"><select name="Sistema" onChange="submitSistema()"
<%call makeSistema%>
</select>
</td>
</tr>
<tr>
<td><span class="style3">Equipos</sp
<td><select name="Equipo" onChange="submitEquipo()">
<%call makeEquipo%>
</select>
</td>
</tr>
<tr>
<td><span class="style3">Elementos a Gráficar </span></td>
<td><select name="Elemento">
<%call makeElemento%>
</select>
</td>
</tr>
<tr>
<td> </td>
<td><input type="submit" value="OK" id=submit13 name=submit13></td>
</tr>
</table>
</FORM>
</BODY>
<%
objConnection.Close
Set objConnection = Nothing
%>
</html>
Please run your page, go to the view menu and select source, and then paste the source here. Once you do that, I should be able to figure out what the issue is.
I have used this code in many places without problem.
Fritz the Blank
I have used this code in many places without problem.
Fritz the Blank
ASKER
Fritz_the_blank
here is it
<html>
<head>
<title>Menu Prueba</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style3 {font-family: Verdana, Arial, Helvetica, sans-serif; color: #993333; }
-->
</style>
</head>
<SCRIPT LANGUAGE=javascript>
<!--
Function submitSistema(){
var objForm = document.forms[0];
objForm.elements['Equipo'] .selectedI ndex=0;
objForm.elements['Elemento '].selecte dIndex = 0;
objForm.submit();
}
Function submitEquipo(){
var objForm = document.forms[0];
objForm.elements['Elemento '].selecte dIndex = 0;
objForm.submit();
}
//-->
</SCRIPT>
<SCRIPT LANGUAGE=javascript>
<!--
Function submitForm(){
var objForm = document.forms[0];
objForm.action = "http://localhost/mantenimiento/Test/menustest.asp"
return true;
}
//-->
</SCRIPT>
<body>
<FORM action="" method=POST id=form1 name=form1 onSubmit="return submitForm()">
<table width="80%" border="0">
<tr>
<td width="44%"><span class="style3">Sistema</sp an></td>
<td width="56%"><select name="Sistema" onChange="submitSistema()" >
<option></option>
<option>BOMBEO</option>
<option>COMPRESION</option >
<option>CONTRAINCENDIO</op tion>
<option>GENERACION</option >
<option>POZOS</option>
<option>SERVICIOS</option>
</select> </td>
</tr>
<tr>
<td><span class="style3">Equipos</sp an></td>
<td><select name="Equipo" onChange="submitEquipo()">
<option>Seleccione un Equipo Primero </option>
</select> </td>
</tr>
<tr>
<td><span class="style3">Elementos a Gráficar </span></td>
<td><select name="Elemento">
<option>Select a Region First</option>
</select> </td>
</tr>
<tr>
<td> </td>
<td><input type="submit" value="OK" id=submit132 name=submit13></td>
</tr>
</table>
</FORM>
</BODY>
</html>
here is it
<html>
<head>
<title>Menu Prueba</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style3 {font-family: Verdana, Arial, Helvetica, sans-serif; color: #993333; }
-->
</style>
</head>
<SCRIPT LANGUAGE=javascript>
<!--
Function submitSistema(){
var objForm = document.forms[0];
objForm.elements['Equipo']
objForm.elements['Elemento
objForm.submit();
}
Function submitEquipo(){
var objForm = document.forms[0];
objForm.elements['Elemento
objForm.submit();
}
//-->
</SCRIPT>
<SCRIPT LANGUAGE=javascript>
<!--
Function submitForm(){
var objForm = document.forms[0];
objForm.action = "http://localhost/mantenimiento/Test/menustest.asp"
return true;
}
//-->
</SCRIPT>
<body>
<FORM action="" method=POST id=form1 name=form1 onSubmit="return submitForm()">
<table width="80%" border="0">
<tr>
<td width="44%"><span class="style3">Sistema</sp
<td width="56%"><select name="Sistema" onChange="submitSistema()"
<option></option>
<option>BOMBEO</option>
<option>COMPRESION</option
<option>CONTRAINCENDIO</op
<option>GENERACION</option
<option>POZOS</option>
<option>SERVICIOS</option>
</select> </td>
</tr>
<tr>
<td><span class="style3">Equipos</sp
<td><select name="Equipo" onChange="submitEquipo()">
<option>Seleccione un Equipo Primero </option>
</select> </td>
</tr>
<tr>
<td><span class="style3">Elementos a Gráficar </span></td>
<td><select name="Elemento">
<option>Select a Region First</option>
</select> </td>
</tr>
<tr>
<td> </td>
<td><input type="submit" value="OK" id=submit132 name=submit13></td>
</tr>
</table>
</FORM>
</BODY>
</html>
Okay I found the first issue: unlike VBScript, JavaScript is case sensitive, so you must write function rather than Function:
<SCRIPT LANGUAGE=javascript>
<!--
function submitSistema(){
var objForm = document.forms[0];
objForm.elements['Equipo'] .selectedI ndex=0;
objForm.elements['Elemento '].selecte dIndex = 0;
objForm.submit();
}
function submitEquipo(){
var objForm = document.forms[0];
objForm.elements['Elemento '].selecte dIndex = 0;
objForm.submit();
}
//-->
<SCRIPT LANGUAGE=javascript>
<!--
function submitSistema(){
var objForm = document.forms[0];
objForm.elements['Equipo']
objForm.elements['Elemento
objForm.submit();
}
function submitEquipo(){
var objForm = document.forms[0];
objForm.elements['Elemento
objForm.submit();
}
//-->
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
So please make those few changes and then try the code please.
FtB
FtB
ASKER
Thank you FtB, accepting the question will give you the points?
Thank you so much and sorry again for the other time...
Thank you to Shailesh15 too
Thank you so much and sorry again for the other time...
Thank you to Shailesh15 too
Fair enough. Please remember that we all volunteer time here without compensation. The only thing that we get back is the gratitude of those asking the questions, so closing out your questions is the right thing to do.
If you feel that others have been helpful, you can post separate questions with the title "Points for Shailesh15" and etc. to show your appreciation.
Good luck with the project.
Fritz the Blank
If you feel that others have been helpful, you can post separate questions with the title "Points for Shailesh15" and etc. to show your appreciation.
Good luck with the project.
Fritz the Blank
But you can also use JavaScript todo it without reloading the page like so. This example is locations but you can replace it with your Sistema, Equipos and Elementos fields
<SCRIPT>var ESTATESLIST = new Array(); ESTATESLIST[0] = new Array(); ESTATESLIST[0][0] = '1'; ESTATESLIST[0][1]= new Array(); ESTATESLIST[0][1][0]= '1'; ESTATESLIST[0][1][1]= 'Andalucia'; ESTATESLIST[0][2]= new Array(); ESTATESLIST[0][2][0]= '4'; ESTATESLIST[0][2][1]= 'Comunidad Valenciana'; ESTATESLIST[1] = new Array(); ESTATESLIST[1][0] = '4'; ESTATESLIST[1][1]= new Array(); ESTATESLIST[1][1][0]= '7'; ESTATESLIST[1][1][1]= 'Provence Alpes Côte d`Azur';var CS_ESTATESLIST = ESTATESLIST;ESTATESLIST = null;</SCRIPT><SCRIPT>var AREASLIST = new Array(); AREASLIST [0] = new Array(); AREASLIST [0][0] = '7'; AREASLIST [0][1]= new Array(); AREASLIST [0][1][0]= '7'; AREASLIST [0][1][1]= 'Alpes-Maritimes'; AREASLIST [1] = new Array(); AREASLIST [1][0] = '4'; AREASLIST [1][1]= new Array(); AREASLIST [1][1][0]= '5'; AREASLIST [1][1][1]= 'Costa Blanca'; AREASLIST [2] = new Array(); AREASLIST [2][0] = '1'; AREASLIST [2][1]= new Array(); AREASLIST [2][1][0]= '1'; AREASLIST [2][1][1]= 'Costa del Sol';var CS_AREASLIST = AREASLIST;AREASLIST = null;</SCRIPT><SCRIPT>var CITIESLIST = new Array(); CITIESLIST [0] = new Array(); CITIESLIST [0][0] = '7'; CITIESLIST [0][1]= new Array(); CITIESLIST [0][1][0]= '115'; CITIESLIST [0][1][1]= 'Agen'; CITIESLIST [0][2]= new Array(); CITIESLIST [0][2][0]= '66'; CITIESLIST [0][2][1]= 'Aix-en-provence'; CITIESLIST [1] = new Array(); CITIESLIST [1][0] = '5'; CITIESLIST [1][1]= new Array(); CITIESLIST [1][1][0]= '101'; CITIESLIST [1][1][1]= 'Albir'; CITIESLIST [2] = new Array(); CITIESLIST [2][0] = '1'; CITIESLIST [2][1]= new Array(); CITIESLIST [2][1][0]= '17'; CITIESLIST [2][1][1]= 'Alhaurin'; CITIESLIST [3] = new Array(); CITIESLIST [3][0] = '5'; CITIESLIST [3][1]= new Array(); CITIESLIST [3][1][0]= '45'; CITIESLIST [3][1][1]= 'Alicante'; CITIESLIST [3][2]= new Array(); CITIESLIST [3][2][0]= '47'; CITIESLIST [3][2][1]= 'Altea'; CITIESLIST [4] = new Array(); CITIESLIST [4][0] = '7'; CITIESLIST [4][1]= new Array(); CITIESLIST [4][1][0]= '67'; CITIESLIST [4][1][1]= 'Antibes'; CITIESLIST [4][2]= new Array(); CITIESLIST [4][2][0]= '111'; CITIESLIST [4][2][1]= 'Bar Sur Loup'; CITIESLIST [5] = new Array(); CITIESLIST [5][0] = '1'; CITIESLIST [5][1]= new Array(); CITIESLIST [5][1][0]= '54'; CITIESLIST [5][1][1]= 'Benahavis'; CITIESLIST [5][2]= new Array(); CITIESLIST [5][2][0]= '31'; CITIESLIST [5][2][1]= 'Benalmadena'; CITIESLIST [6] = new Array(); CITIESLIST [6][0] = '5'; CITIESLIST [6][1]= new Array(); CITIESLIST [6][1][0]= '50'; CITIESLIST [6][1][1]= 'Benidorm'; CITIESLIST [6][2]= new Array(); CITIESLIST [6][2][0]= '56'; CITIESLIST [6][2][1]= 'Benissa'; CITIESLIST [6][3]= new Array(); CITIESLIST [6][3][0]= '59'; CITIESLIST [6][3][1]= 'Benitachell'; CITIESLIST [7] = new Array(); CITIESLIST [7][0] = '7'; CITIESLIST [7][1]= new Array(); CITIESLIST [7][1][0]= '68'; CITIESLIST [7][1][1]= 'Biot'; CITIESLIST [7][2]= new Array(); CITIESLIST [7][2][0]= '69'; CITIESLIST [7][2][1]= 'Bourgogne '; CITIESLIST [8] = new Array(); CITIESLIST [8][0] = '1'; CITIESLIST [8][1]= new Array(); CITIESLIST [8][1][0]= '22'; CITIESLIST [8][1][1]= 'Cabopino'; CITIESLIST [9] = new Array(); CITIESLIST [9][0] = '7'; CITIESLIST [9][1]= new Array(); CITIESLIST [9][1][0]= '70'; CITIESLIST [9][1][1]= 'Cagnes Sur Mer'; CITIESLIST [10] = new Array(); CITIESLIST [10][0] = '1'; CITIESLIST [10][1]= new Array(); CITIESLIST [10][1][0]= '6'; CITIESLIST [10][1][1]= 'Calahonda'; CITIESLIST [11] = new Array(); CITIESLIST [11][0] = '5'; CITIESLIST [11][1]= new Array(); CITIESLIST [11][1][0]= '42'; CITIESLIST [11][1][1]= 'Calpe'; CITIESLIST [12] = new Array(); CITIESLIST [12][0] = '7'; CITIESLIST [12][1]= new Array(); CITIESLIST [12][1][0]= '71'; CITIESLIST [12][1][1]= 'Cannes'; CITIESLIST [12][2]= new Array(); CITIESLIST [12][2][0]= '72'; CITIESLIST [12][2][1]= 'Cavalaire'; CITIESLIST [12][3]= new Array(); CITIESLIST [12][3][0]= '73'; CITIESLIST [12][3][1]= 'Chateauneuf De Grasse'; CITIESLIST [13] = new Array(); CITIESLIST [13][0] = '5'; CITIESLIST [13][1]= new Array(); CITIESLIST [13][1][0]= '44'; CITIESLIST [13][1][1]= 'Denia'; CITIESLIST [14] = new Array(); CITIESLIST [14][0] = '1'; CITIESLIST [14][1]= new Array(); CITIESLIST [14][1][0]= '37'; CITIESLIST [14][1][1]= 'Duquesa'; CITIESLIST [15] = new Array(); CITIESLIST [15][0] = '5'; CITIESLIST [15][1]= new Array(); CITIESLIST [15][1][0]= '100'; CITIESLIST [15][1][1]= 'El Campello'; CITIESLIST [16] = new Array(); CITIESLIST [16][0] = '1'; CITIESLIST [16][1]= new Array(); CITIESLIST [16][1][0]= '24'; CITIESLIST [16][1][1]= 'El Rosario'; CITIESLIST [17] = new Array(); CITIESLIST [17][0] = '5'; CITIESLIST [17][1]= new Array(); CITIESLIST [17][1][0]= '105'; CITIESLIST [17][1][1]= 'El Vergel'; CITIESLIST [17][2]= new Array(); CITIESLIST [17][2][0]= '106'; CITIESLIST [17][2][1]= 'Elda'; CITIESLIST [18] = new Array(); CITIESLIST [18][0] = '1'; CITIESLIST [18][1]= new Array(); CITIESLIST [18][1][0]= '7'; CITIESLIST [18][1][1]= 'Elviria'; CITIESLIST [18][2]= new Array(); CITIESLIST [18][2][0]= '30'; CITIESLIST [18][2][1]= 'Estepona & West'; CITIESLIST [18][3]= new Array(); CITIESLIST [18][3][0]= '27'; CITIESLIST [18][3][1]= 'Estepona East'; CITIESLIST [19] = new Array(); CITIESLIST [19][0] = '7'; CITIESLIST [19][1]= new Array(); CITIESLIST [19][1][0]= '122'; CITIESLIST [19][1][1]= 'Eze-sur-mer'; CITIESLIST [20] = new Array(); CITIESLIST [20][0] = '5'; CITIESLIST [20][1]= new Array(); CITIESLIST [20][1][0]= '108'; CITIESLIST [20][1][1]= 'Fanadix'; CITIESLIST [21] = new Array(); CITIESLIST [21][0] = '7'; CITIESLIST [21][1]= new Array(); CITIESLIST [21][1][0]= '74'; CITIESLIST [21][1][1]= 'Frejus'; CITIESLIST [22] = new Array(); CITIESLIST [22][0] = '1'; CITIESLIST [22][1]= new Array(); CITIESLIST [22][1][0]= '40'; CITIESLIST [22][1][1]= 'Fuengirola'; CITIESLIST [23] = new Array(); CITIESLIST [23][0] = '5'; CITIESLIST [23][1]= new Array(); CITIESLIST [23][1][0]= '48'; CITIESLIST [23][1][1]= 'Gandia'; CITIESLIST [24] = new Array(); CITIESLIST [24][0] = '1'; CITIESLIST [24][1]= new Array(); CITIESLIST [24][1][0]= '39'; CITIESLIST [24][1][1]= 'Girona'; CITIESLIST [25] = new Array(); CITIESLIST [25][0] = '7'; CITIESLIST [25][1]= new Array(); CITIESLIST [25][1][0]= '75'; CITIESLIST [25][1][1]= 'Golfe-juan'; CITIESLIST [25][2]= new Array(); CITIESLIST [25][2][0]= '76'; CITIESLIST [25][2][1]= 'Grasse'; CITIESLIST [25][3]= new Array(); CITIESLIST [25][3][0]= '116'; CITIESLIST [25][3][1]= 'Grimaud'; CITIESLIST [25][4]= new Array(); CITIESLIST [25][4][0]= '119'; CITIESLIST [25][4][1]= 'Gujan-mestras'; CITIESLIST [26] = new Array(); CITIESLIST [26][0] = '5'; CITIESLIST [26][1]= new Array(); CITIESLIST [26][1][0]= '58'; CITIESLIST [26][1][1]= 'Jalon '; CITIESLIST [26][2]= new Array(); CITIESLIST [26][2][0]= '41'; CITIESLIST [26][2][1]= 'Javea/Xabia'; CITIESLIST [27] = new Array(); CITIESLIST [27][0] = '7'; CITIESLIST [27][1]= new Array(); CITIESLIST [27][1][0]= '77'; CITIESLIST [27][1][1]= 'Juan Les Pins'; CITIESLIST [27][2]= new Array(); CITIESLIST [27][2][0]= '78'; CITIESLIST [27][2][1]= 'La Colle Sur Loup'; CITIESLIST [28] = new Array(); CITIESLIST [28][0] = '5'; CITIESLIST [28][1]= new Array(); CITIESLIST [28][1][0]= '109'; CITIESLIST [28][1][1]= 'La Fustera'; CITIESLIST [29] = new Array(); CITIESLIST [29][0] = '7'; CITIESLIST [29][1]= new Array(); CITIESLIST [29][1][0]= '79'; CITIESLIST [29][1][1]= 'La Grande Motte'; CITIESLIST [29][2]= new Array(); CITIESLIST [29][2][0]= '113'; CITIESLIST [29][2][1]= 'La Roquette Sur Var'; CITIESLIST [29][3]= new Array(); CITIESLIST [29][3][0]= '117'; CITIESLIST [29][3][1]= 'La Trayas'; CITIESLIST [30] = new Array(); CITIESLIST [30][0] = '1'; CITIESLIST [30][1]= new Array(); CITIESLIST [30][1][0]= '28'; CITIESLIST [30][1][1]= 'La Zagaleta'; CITIESLIST [30][2]= new Array(); CITIESLIST [30][2][0]= '23'; CITIESLIST [30][2][1]= 'Las Chapas'; CITIESLIST [31] = new Array(); CITIESLIST [31][0] = '7'; CITIESLIST [31][1]= new Array(); CITIESLIST [31][1][0]= '80'; CITIESLIST [31][1][1]= 'Le Cannet'; CITIESLIST [31][2]= new Array(); CITIESLIST [31][2][0]= '81'; CITIESLIST [31][2][1]= 'Le Muy'; CITIESLIST [31][3]= new Array(); CITIESLIST [31][3][0]= '124'; CITIESLIST [31][3][1]= 'Le Thoronet'; CITIESLIST [31][4]= new Array(); CITIESLIST [31][4][0]= '118'; CITIESLIST [31][4][1]= 'Les Arcs'; CITIESLIST [32] = new Array(); CITIESLIST [32][0] = '1'; CITIESLIST [32][1]= new Array(); CITIESLIST [32][1][0]= '65'; CITIESLIST [32][1][1]= 'Los Arqueros'; CITIESLIST [32][2]= new Array(); CITIESLIST [32][2][0]= '8'; CITIESLIST [32][2][1]= 'Los Monteros'; CITIESLIST [32][3]= new Array(); CITIESLIST [32][3][0]= '52'; CITIESLIST [32][3][1]= 'Malaga'; CITIESLIST [33] = new Array(); CITIESLIST [33][0] = '7'; CITIESLIST [33][1]= new Array(); CITIESLIST [33][1][0]= '125'; CITIESLIST [33][1][1]= 'Mandelieu'; CITIESLIST [34] = new Array(); CITIESLIST [34][0] = '1'; CITIESLIST [34][1]= new Array(); CITIESLIST [34][1][0]= '9'; CITIESLIST [34][1][1]= 'Manilva'; CITIESLIST [34][2]= new Array(); CITIESLIST [34][2][0]= '1'; CITIESLIST [34][2][1]= 'Marbella Central'; CITIESLIST [35] = new Array(); CITIESLIST [35][0] = '7'; CITIESLIST [35][1]= new Array(); CITIESLIST [35][1][0]= '126'; CITIESLIST [35][1][1]= 'Menton'; CITIESLIST [36] = new Array(); CITIESLIST [36][0] = '1'; CITIESLIST [36][1]= new Array(); CITIESLIST [36][1][0]= '19'; CITIESLIST [36][1][1]= 'Mijas Costa'; CITIESLIST [36][2]= new Array(); CITIESLIST [36][2][0]= '18'; CITIESLIST [36][2][1]= 'Mijas Golf'; CITIESLIST [36][3]= new Array(); CITIESLIST [36][3][0]= '10'; CITIESLIST [36][3][1]= 'Monte Mayor'; CITIESLIST [37] = new Array(); CITIESLIST [37][0] = '5'; CITIESLIST [37][1]= new Array(); CITIESLIST [37][1][0]= '43'; CITIESLIST [37][1][1]= 'Moraira'; CITIESLIST [38] = new Array(); CITIESLIST [38][0] = '7'; CITIESLIST [38][1]= new Array(); CITIESLIST [38][1][0]= '82'; CITIESLIST [38][1][1]= 'Mouans Sartoux'; CITIESLIST [38][2]= new Array(); CITIESLIST [38][2][0]= '83'; CITIESLIST [38][2][1]= 'Mougins'; CITIESLIST [39] = new Array(); CITIESLIST [39][0] = '5'; CITIESLIST [39][1]= new Array(); CITIESLIST [39][1][0]= '46'; CITIESLIST [39][1][1]= 'Murcia'; CITIESLIST [40] = new Array(); CITIESLIST [40][0] = '7'; CITIESLIST [40][1]= new Array(); CITIESLIST [40][1][0]= '84'; CITIESLIST [40][1][1]= 'Nice'; CITIESLIST [41] = new Array(); CITIESLIST [41][0] = '5'; CITIESLIST [41][1]= new Array(); CITIESLIST [41][1][0]= '60'; CITIESLIST [41][1][1]= 'Nucia/Polop'; CITIESLIST [42] = new Array(); CITIESLIST [42][0] = '1'; CITIESLIST [42][1]= new Array(); CITIESLIST [42][1][0]= '11'; CITIESLIST [42][1][1]= 'Nueva Andalucia'; CITIESLIST [43] = new Array(); CITIESLIST [43][0] = '5'; CITIESLIST [43][1]= new Array(); CITIESLIST [43][1][0]= '49'; CITIESLIST [43][1][1]= 'Oliva'; CITIESLIST [43][2]= new Array(); CITIESLIST [43][2][0]= '102'; CITIESLIST [43][2][1]= 'Ondara'; CITIESLIST [44] = new Array(); CITIESLIST [44][0] = '7'; CITIESLIST [44][1]= new Array(); CITIESLIST [44][1][0]= '85'; CITIESLIST [44][1][1]= 'Opio'; CITIESLIST [45] = new Array(); CITIESLIST [45][0] = '5'; CITIESLIST [45][1]= new Array(); CITIESLIST [45][1][0]= '110'; CITIESLIST [45][1][1]= 'Orihuela'; CITIESLIST [45][2]= new Array(); CITIESLIST [45][2][0]= '103'; CITIESLIST [45][2][1]= 'Pedreguer'; CITIESLIST [45][3]= new Array(); CITIESLIST [45][3][0]= '107'; CITIESLIST [45][3][1]= 'Pego'; CITIESLIST [46] = new Array(); CITIESLIST [46][0] = '7'; CITIESLIST [46][1]= new Array(); CITIESLIST [46][1][0]= '86'; CITIESLIST [46][1][1]= 'Peymeinade'; CITIESLIST [46][2]= new Array(); CITIESLIST [46][2][0]= '121'; CITIESLIST [46][2][1]= 'Pierrefeu'; CITIESLIST [46][3]= new Array(); CITIESLIST [46][3][0]= '87'; CITIESLIST [46][3][1]= 'Plascassier'; CITIESLIST [47] = new Array(); CITIESLIST [47][0] = '1'; CITIESLIST [47][1]= new Array(); CITIESLIST [47][1][0]= '13'; CITIESLIST [47][1][1]= 'Puerto Banus'; CITIESLIST [47][2]= new Array(); CITIESLIST [47][2][0]= '25'; CITIESLIST [47][2][1]= 'Rio Real'; CITIESLIST [47][3]= new Array(); CITIESLIST [47][3][0]= '20'; CITIESLIST [47][3][1]= 'Riviera'; CITIESLIST [48] = new Array(); CITIESLIST [48][0] = '7'; CITIESLIST [48][1]= new Array(); CITIESLIST [48][1][0]= '88'; CITIESLIST [48][1][1]= 'Roquebrune-cap-martin'; CITIESLIST [48][2]= new Array(); CITIESLIST [48][2][0]= '89'; CITIESLIST [48][2][1]= 'Rouqefort Les Pins'; CITIESLIST [48][3]= new Array(); CITIESLIST [48][3][0]= '90'; CITIESLIST [48][3][1]= 'Saint Paul De Vence '; CITIESLIST [48][4]= new Array(); CITIESLIST [48][4][0]= '91'; CITIESLIST [48][4][1]= 'Sainte Maxime'; CITIESLIST [49] = new Array(); CITIESLIST [49][0] = '1'; CITIESLIST [49][1]= new Array(); CITIESLIST [49][1][0]= '2'; CITIESLIST [49][1][1]= 'San Pedro'; CITIESLIST [50] = new Array(); CITIESLIST [50][0] = '5'; CITIESLIST [50][1]= new Array(); CITIESLIST [50][1][0]= '123'; CITIESLIST [50][1][1]= 'Santa Pola'; CITIESLIST [50][2]= new Array(); CITIESLIST [50][2][0]= '104'; CITIESLIST [50][2][1]= 'Sax'; CITIESLIST [51] = new Array(); CITIESLIST [51][0] = '7'; CITIESLIST [51][1]= new Array(); CITIESLIST [51][1][0]= '112'; CITIESLIST [51][1][1]= 'Seillans'; CITIESLIST [52] = new Array(); CITIESLIST [52][0] = '1'; CITIESLIST [52][1]= new Array(); CITIESLIST [52][1][0]= '26'; CITIESLIST [52][1][1]= 'Sierra Blanca'; CITIESLIST [52][2]= new Array(); CITIESLIST [52][2][0]= '38'; CITIESLIST [52][2][1]= 'Sotogrande'; CITIESLIST [53] = new Array(); CITIESLIST [53][0] = '7'; CITIESLIST [53][1]= new Array(); CITIESLIST [53][1][0]= '114'; CITIESLIST [53][1][1]= 'Speracedes'; CITIESLIST [53][2]= new Array(); CITIESLIST [53][2][0]= '92'; CITIESLIST [53][2][1]= 'St Jeanette'; CITIESLIST [53][3]= new Array(); CITIESLIST [53][3][0]= '93'; CITIESLIST [53][3][1]= 'St Raphael'; CITIESLIST [53][4]= new Array(); CITIESLIST [53][4][0]= '94'; CITIESLIST [53][4][1]= 'St Tropez'; CITIESLIST [54] = new Array(); CITIESLIST [54][0] = '5'; CITIESLIST [54][1]= new Array(); CITIESLIST [54][1][0]= '57'; CITIESLIST [54][1][1]= 'Teulada'; CITIESLIST [55] = new Array(); CITIESLIST [55][0] = '1'; CITIESLIST [55][1]= new Array(); CITIESLIST [55][1][0]= '32'; CITIESLIST [55][1][1]= 'Torremolinos'; CITIESLIST [56] = new Array(); CITIESLIST [56][0] = '5'; CITIESLIST [56][1]= new Array(); CITIESLIST [56][1][0]= '62'; CITIESLIST [56][1][1]= 'Torrevieja'; CITIESLIST [57] = new Array(); CITIESLIST [57][0] = '7'; CITIESLIST [57][1]= new Array(); CITIESLIST [57][1][0]= '120'; CITIESLIST [57][1][1]= 'Tourrettes Sur Loup'; CITIESLIST [57][2]= new Array(); CITIESLIST [57][2][0]= '95'; CITIESLIST [57][2][1]= 'Valbonne'; CITIESLIST [58] = new Array(); CITIESLIST [58][0] = '1'; CITIESLIST [58][1]= new Array(); CITIESLIST [58][1][0]= '53'; CITIESLIST [58][1][1]= 'Velez Malaga'; CITIESLIST [59] = new Array(); CITIESLIST [59][0] = '7'; CITIESLIST [59][1]= new Array(); CITIESLIST [59][1][0]= '96'; CITIESLIST [59][1][1]= 'Vence'; CITIESLIST [59][2]= new Array(); CITIESLIST [59][2][0]= '97'; CITIESLIST [59][2][1]= 'Vidauban'; CITIESLIST [60] = new Array(); CITIESLIST [60][0] = '5'; CITIESLIST [60][1]= new Array(); CITIESLIST [60][1][0]= '61'; CITIESLIST [60][1][1]= 'Villajoyosa'; CITIESLIST [61] = new Array(); CITIESLIST [61][0] = '7'; CITIESLIST [61][1]= new Array(); CITIESLIST [61][1][0]= '98'; CITIESLIST [61][1][1]= 'Villefranche Sur Mer'; CITIESLIST [61][2]= new Array(); CITIESLIST [61][2][0]= '99'; CITIESLIST [61][2][1]= 'Villeneuve Loubet';var CS_CITIESLIST = CITIESLIST;CITIESLIST = null;</SCRIPT>
<SCRIPT language="JavaScript">
<!--
function WA_UnloadList(thelist,leav
while (thelist.options.length != leavevals+bottomnum) {
thelist.options[leavevals]
}
return leavevals;
}
function WA_FilterAndPopulateSubLis
startid = WA_UnloadList(targetselect
mainids = new Array();
if (usesource) maintext = new Array();
for (var j=0; j<sourceselect.options.len
if (sourceselect.options[j].s
mainids[mainids.length] = sourceselect.options[j].va
if (usesource) maintext[maintext.length] = sourceselect.options[j].te
}
}
for (var i=0; i<thearray.length; i++) {
goodid = false;
for (var h=0; h<mainids.length; h++) {
if (thearray[i][0] == mainids[h]) {
goodid = true;
break;
}
}
if (goodid) {
theBox = targetselect;
theLength = parseInt(theBox.options.le
theServices = thearray[i].length + startid;
var l=1;
for (var k=startid; k<theServices; k++) {
if (l == thearray[i].length) break;
theBox.options[k] = new Option();
theBox.options[k].value = thearray[i][l][0];
if (usesource) theBox.options[k].text = thearray[i][l][1];
else theBox.options[k].text = thearray[i][l][1];
l++;
}
startid = k;
}
}
}
//-->
</SCRIPT>