Ad
Repeater Widget - JQuery Detect Does Not Work
The below code works fine with other form element other than "repeater widget" elements in Laravel -> octobercms -> backend ->plugin -> form
$(document).ready(function() {
$('.form-control').on('mouseover',function(){
alert('hi');
});
})
When I hover over normal input fields in the form, I get the alert message. But when I use add repeater elements that contains input field, mouse over them does not trigger alert.
Kindly help.
Regards
Ad
Answer
Try using event delegation. There isn't really enough known as to why your approach isn't working unless the elements are added after your code runs such as through ajax
$(document).on('mouseover','.form-control',function(){
alert('hi');
});
Ad
source: stackoverflow.com
Related Questions
- → OctoberCMS - How to make collapsible list default to active only on non-mobile
- → How to update data attribute on Ajax complete
- → October CMS - Radio Button Ajax Click Twice in a Row Causes Content to disappear
- → Octobercms Component Unique id (Twig & Javascript)
- → when i send data with ajax(jquery) i don't find the values in controller without form in laravel 5.1
- → DropzoneJS & Laravel - Output form validation errors
- → Knockout JS - How to return empty strings for observable fields
- → How to replace *( in a string
- → Get the calling element with vue.js
- → Sent Variable to Controller via Ajax in Blade
- → AJAX folder path issue
- → Onclick with argument causes javascript syntax error
- → KNockout JS - Automatic reload of ajax call
Ad