Skip to content

Not able to make this work - no filename. Script and  #92

@MacelinCane

Description

@MacelinCane

I've installed via NPM into my Laravel 8 project.
I've added all this at the bottom of my page

<script src="./coverage/bs-custom-file-input.js"></script>
<script>
    bsCustomFileInput.init();

    var btn = document.getElementById('btnResetForm');
    var form = document.querySelector('form');
    btn.addEventListener('click', function () {
        form.reset()
    })
</script>

I've added this to my form
<div class="input-group mt-3"> <div class="custom-file"> <input id="inputGroupFile01" type="file" class="custom-file-input"> <label class="custom-file-label" for="inputGroupFile01">Choose file</label> </div> </div>
When I click Browse, I am able to choose a file, but nothing else. No filename shows.
I see "use with npm - import bsCustomFileInput from 'bs-custom-file-input'" but I'm not sure what this means if I've already installed it via npm.

I have a 404 for the js file and an uncaught ref error bsCustomFileInput is not defined.

What am I missing?
Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions