MVC page has form. but the control is not hit when debug the jquey code.
the breakpoint is not reaching inside of this code : document.addEventListener("DOMContentLoaded", function () {
The MVC form has below form.
i call the below code one of the javascript method.
document.addEventListener("DOMContentLoaded", function () {
let form = document.forms["update"];
if (form) {
form.addEventListener("submit", function (e) {
e.preventDefault(); // Stop default form submission
setTimeout(() => {
console.log("Submitting form...");
form.submit(); // Submit after delay
}, 100);
});
} else {
console.log("Form not found");
}
});