I have two dropdownlists in an ASP.NET web form using jQuery to populate them and re-populate the child list when the parent is changed. The parent list is loading properly but the child list is not loading or updating. The child records are stored in text files in a folder called textdata and are arranged like so:
<option>User Name</option>
<option>User ID</option>
<option>User ID Lower</option>
<option>User Email</option>
<option>User Phone</option>
<option>User Fax</option>
The parent records are also stored in a text file in a file on the root called MergeCodeGroups.txt, which is arranged in a similar fashion. Following is the page code. Does anyone see my mistake? Any help is greatly appreciated! Thanks! Mike
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Test.aspx.vb" Inherits="TextControl2016.Test" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="Scripts/jquery-1.10.2.js"></script>
<script type="text/javascript">
// Load merge code groups and merge codes
function loadDDLMergeCodeGroups() {
$(document).ready(function () {
$("#ddlMergeCodeGroup").load("MergeCodeGroups.txt");
});
}
function loadDDLMergeCodes() {
$("#ddlMergeCodeGroup").change(function () {
$("#ddlMergeCode").load(encodeURI("textdata/" + $(this).val() + ".txt"));
});
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<script type="text/javascript">
loadDDLMergeCodeGroups();
loadDDLMergeCodes();
</script>Merge Code Group
<select id='ddlMergeCodeGroup' name='ddlMergeCodeGroup'></select>
Merge Code
<select id='ddlMergeCode' name='ddlMergeCode'></select>
</div>
</form>
</body>
</html>