Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

339
Views
trigger b-form-file after clicking on b-button

I'm working with BootstrapVue and I want to trigger my b-form-file after clicking on my b-button, because of style cases. I also want to have the b-form-file hidden it shouldn't been seen anywhere.

I've tried to do it like following but this doesn't work out for me..

<b-button variant="danger" @click="$refs.upload.click()">Upload</b-button>

<b-form-file ref="upload"></b-form-file>

Please let me know if you have any idea how I can fix that! Thank You!

-> I want to advoid jQuery code and I can't use base HTML input - I need b-form-file

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You must required to make a method for click on for example:

<b-button variant="danger" @click="open">Upload</b-button>
<b-form-file id="upload"></b-form-file>

<script>
     export default {
          methods: {
            open: ()=> {document.getElementById('upload').click()},
          }
     }
</script>
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!