Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

142
Vistas
Why can't I update a dropdown list based on a second dropdown list?

I have two dropdown lists on a classic asp page:

<select id="ddlState" name="ddlState" runat="server">
<option value="KY">Kentucky</option>
<option value="IN">Indiana</option>
<option value="OH">Ohio</option>
<option value="TN">Tennessee</option>
</select>

<select name="ddlCounty">
<% if ddlState = "KY" then %>
<option>Adair</option>
<option>Allen</option>
<option>Anderson</option>
<% end if %>

<option>IN County</option>
<option>OH County</option>
<option>TN County</option>
</select>

I am attempting to figure out what is wrong with the following:

<%
    response.write "Test"
    response.write "<br />"
    response.write ddlState
    response.write "<br />"
    response.write "Test2"

%>

I've tried these variations, as well:

response.write StateDropdown.value

and

Dim ddlState 
set ddlState = document.getElementById("ddlState")
response.write ddlState.value

Anyone know what I am doing wrong, here? I wish I didn't have to use classic asp, but it is what it is and I am not super familiar with it.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I was able to accomplish my objectives by using multiple dropdown lists and showing/hiding them.

$(document).on('ready', function () {


$("#ddlCountyKY").show()
$("#ddlCountyOH").hide()
$("#ddlCountyIN").hide()
$("#ddlCountyTN").hide()

$("#ddlState").on('change', function () {
    var el = $(this);
    if (el.val() === "KY") {
        $("#ddlCountyKY").show()
        $("#ddlCountyOH").hide()
        $("#ddlCountyIN").hide()
        $("#ddlCountyTN").hide()
    } else if (el.val() === "OH") {
        $("#ddlCountyKY").hide()
        $("#ddlCountyOH").show()
        $("#ddlCountyIN").hide()
        $("#ddlCountyTN").hide()
    } else if (el.val() === "IN") {
        $("#ddlCountyKY").hide()
        $("#ddlCountyOH").hide()
        $("#ddlCountyIN").show()
        $("#ddlCountyTN").hide()
    } else if (el.val() === "TN") {
        $("#ddlCountyKY").hide()
        $("#ddlCountyOH").hide()
        $("#ddlCountyIN").hide()
        $("#ddlCountyTN").show()
    }
});

});

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda