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

141
Views
Change both placeholder and value of BootStrapVue forms via innerHTML

Let's suppose we have defined a simple form using bootstrapvue with only one field:

 <div id="myForm">
    <b-form-group horizontal :label-cols="4" required label="Specify the date"> 
          <b-form-datepicker v-model.trim="date"></b-form-datepicker>
        </b-form-group>
</div>

When a certain button is clicked in my application, a JavaScript function gets invoked (let's call it functA). What I'm trying to do is, change both the value and placeholder of the date field in the form (via innerhtml).

So it would be something like this:

functA(newPlaceHolder) {   //This function's intended behavior is to change the date field placeholder in the form
document.getElementById("myForm").innerHTML=' [...]change the placeholder of the attribute *date* so that it uses the one passed as parameter to the function';

}

How could this be done? I've tried several things before, but none of them working.

Thank you very much for your attention.

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

0

I think you are referring to the div by calling getElementById, however, the div is not a placeholder for text so you should call getElementById("").innerHTML on an attribute that holds text.

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!