Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

137
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!