CoffeeZombie
CoffeeZombie
CC#
Created by CoffeeZombie on 1/10/2023 in #help
Javascript/JQuery 3.6.0 help [Self-Resolved]
I knew it'd be silly. The solution was to move it out of $(document).Ready:
<script type="text/javascript">

$(document).ready(function () {

$('#ddlCategory').change(function () {
$.ajax({
type: "post",
url: "/LogPhoneCalls/GetSubcategories",
data: { selectedCategoryID: $('#ddlCategory').val() },
datatype: "json",
traditional: true,
success: function (data) {
var subcategory = "<select id='ddlSubcategory'>";
subcategory = subcategory + '<option value="">--Select--</option>';
for (var i = 0; i < data.length; i++)
{
subcategory = subcategory + '<option value=' + data[i].Value + '>' + data[i].Text + '</option>';
}
subcategory = subcategory + '</select>';
$('#Subcategory').html(subcategory);
}
});
});
});

$(document).on('change', '#ddlSubcategory', function () {
$.ajax({
type: "post",
url: "/LogPhoneCalls/GetResolutions",
data: {
selectedCategoryID: $('#ddlCategory').val(),
selectedSubcategoryID: $('#ddlSubcategory').val()
},
datatype: "json",
traditional: true,
success: function (data) {
var resolution = "<select id='ddlResolution'>";
resolution = resolution + '<option value="">--Select--</option>';
for (var i = 0; i < data.length; i++) {
resolution = resolution + '<option value=' + data[i].Value + '>' + data[i].Text + '</option>';
}
resolution = resolution + '</select>';
$('#Resolution').html(resolution);
}
});
});
</script>
<script type="text/javascript">

$(document).ready(function () {

$('#ddlCategory').change(function () {
$.ajax({
type: "post",
url: "/LogPhoneCalls/GetSubcategories",
data: { selectedCategoryID: $('#ddlCategory').val() },
datatype: "json",
traditional: true,
success: function (data) {
var subcategory = "<select id='ddlSubcategory'>";
subcategory = subcategory + '<option value="">--Select--</option>';
for (var i = 0; i < data.length; i++)
{
subcategory = subcategory + '<option value=' + data[i].Value + '>' + data[i].Text + '</option>';
}
subcategory = subcategory + '</select>';
$('#Subcategory').html(subcategory);
}
});
});
});

$(document).on('change', '#ddlSubcategory', function () {
$.ajax({
type: "post",
url: "/LogPhoneCalls/GetResolutions",
data: {
selectedCategoryID: $('#ddlCategory').val(),
selectedSubcategoryID: $('#ddlSubcategory').val()
},
datatype: "json",
traditional: true,
success: function (data) {
var resolution = "<select id='ddlResolution'>";
resolution = resolution + '<option value="">--Select--</option>';
for (var i = 0; i < data.length; i++) {
resolution = resolution + '<option value=' + data[i].Value + '>' + data[i].Text + '</option>';
}
resolution = resolution + '</select>';
$('#Resolution').html(resolution);
}
});
});
</script>
2 replies
CC#
Created by gododo on 11/16/2022 in #help
❔ Help me out please
This is known as a Caesar Shift. I did find some interesting tutorials online. No dictionaries necessary, you can do it with some math and some casting.
31 replies
CC#
Created by Mastalt on 11/18/2022 in #help
❔ Sort a list
This gives another perspective on writing a custom comparer that you can use when sorting a list of Object https://www.geeksforgeeks.org/how-to-sort-object-array-by-specific-property-in-c-sharp/
5 replies
CC#
Created by Mastalt on 11/18/2022 in #help
❔ Sort a list
I'm a little unclear about what you're asking. This may give a little more detail: https://stackoverflow.com/questions/925471/sorting-a-list-of-objects-in-c-sharp
5 replies
CC#
Created by Mastalt on 11/18/2022 in #help
❔ Sort a list
Depends on what the sort rules are for the data types of a and b.
5 replies
CC#
Created by CoffeeZombie on 8/18/2022 in #help
Microsoft, SMTP, and OAuth2.0 [Workaround proposed]
Yeah, or Gmail. Plus we'll be spared the first wave of deprecation at least, so thankfully this isn't urgent. I'll gleefully tell my boss we're wasting our money on the O365 subscription...
8 replies