I need to get the dropdown box value based on the previous dropdown box value in my code I need to get the first name and based on that I need to get last name in another drop down box please find my code.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
var List;
jQuery.ajax({
url: "http://some ip address/igasp-admin/api.php/um_users?&transform=1",
type: "GET",
dataType: "json",
async: false,
success: function (data) {
var i;
List = data.um_users
$('#userData').empty();
for (i in List ) {
$('#userData').append('<option value="'+ List[i].last_name + '">' + List[i].first_name + '</option>');
$('#userorgData').append('<option value="">'+ List[i].last_name + '</option>');
}
}
});
});
</script>
</head>
<body>
<select style="width: 250px;" id="userData">
</select>
<select style="width: 250px;" id="userorgData">
</select>
</body>
</html>