When a row on a grid is clicked a popup form is opened. Inside the form I setup a Razor Kendo DropDownList from a database. I was able to mange the DropDownList to change HTML tables based on the drop down value. However, when the form is initially loaded I am not able to show the correct table in other words i am not able to get the value of the current displayed item.
This is how I change tables when the user select different item in the menu:
$(function () {
$('#PaymentType_ID').change(function () {
$('.payment').hide();
if ($(this).val() == "5") {
$('.payment').hide();
}
if ($(this).val() == "2") {
$('#creditCardPayment').show();
$('#generalPayment').show();
}
if ($(this).val() == "1" || $(this).val() == "3" || $(this).val() == "4") {
$('#otherPayment').show();
$('#generalPayment').show();
}
});
});
I want to reuse most of the code but instead of using on .change I want to use something like .ready but it does not work.
Anyone has any idea how should I try?