Couple of suggestion
1. replace
$('#EditInv').on('Click', 'input.dtl', function () {
with
$('#EditInv').on('click', function () {
. I think the
Click
is case sensitive and I don't think the code need to include
'input.dtl'
because it referencing the same element not parent child relationship
2. I don't think the
onclick="PopupForm('@Url.Action("EditInv","Perchus")')"
is necessary, if the jQuery is wiring the onclick event, the JavaScript should look like below
$('#EditInv').on('click', function () {
var formDiv = $('<div/>');
let url = '@Url.Action("EditInv","Perchus")';
$.get(url)
.done(function (response) {
formDiv.html(response);
popup = formDiv.dialog({
autoOpen: true,
resizable: false,
title: 'EDIT INVOICE REORD',
height: 500,
width: 600,
close: function () {
popup.dialog('distroy').remove();
}
});
});
});
3. On the other hand if you prefer the code to use button click event, then the JavaScript should look like
function PopupForm(url) {
var formDiv = $('<div/>');
$.get(url)
.done(function (response) {
formDiv.html(response);
popup = formDiv.dialog({
autoOpen: true,
resizable: false,
title: 'EDIT INVOICE REORD',
height: 500,
width: 600,
close: function () {
popup.dialog('distroy').remove();
}
});
});
}
Reference:
.on() | jQuery API Documentation[
^]