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.
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()
}
});
});