Hi,
I just want to alert user when user input some data in input field, for example
https://preview.keenthemes.com/metronic8/demo35/apps/ecommerce/catalog/edit-category.html
in input field Category name. So I added simple script at the bottom of the page, like this,
<!--end::Custom Javascript-->
<script>
alert($('#category_name').val());
</script>
<!--end::Javascript-->
But I got an error "undefined"
What is going on? How can I get value from input field?
Great, it works now. Thank you a lot.
Hi,
Please try to run your code in
KTUtil.onDOMContentLoaded(function() {
// your code
});
window.onload = (event) => {
// your code
};
Hi,
It works if I do as you said when form is as html page. But if the form is in the modal, it reports the same error again even if I do as you said.
"undefined"
Hi,
Inside modal you can use:
<script>
window.addEventListener("load", () => {
/// your code
});
</script>