This is my code, i have tried a lot of version but none works. Funnily i had no issues with other js i added in the view. Any help appreciated. Edit: The issue happens because this is a secondary form after the initial so i suppose livewire is not running the JS code. I even tried livewire:load as below:
@push('scripts') <script> document.addEventListener('livewire:load', function () { function focusNextInput(el, prevId, nextId) { if (el.value.length === 0) { if (prevId) { document.getElementById(prevId).focus(); } } else { if (nextId) { document.getElementById(nextId).focus(); } } }
Use the number input component to set a numeric value inside a form field based on multiple styles, variants, and layouts that can be used in product pages, forms, and more