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

189
Views
How to write pre filled input in bootbox

I want bootbox to fill var name into bootbox input on click update button, but it is not doing it. I have also highlighted the same in the code below

$(document).on("click", ".update", function () {
      var button = $(event.relatedTarget); /*Button that triggered the modal*/
      var name = button.data('name');
      modal.find('.bootbox-input-text').val(name); 
      $('.bootbox-form').find('input').val(name); /* Not Working */
      bootbox.prompt({
        title: 'Enter Description',
        placeholder: 'my placeholder',
        
        buttons: {
          confirm: {
            label: 'Submit'
          }
        },
        callback: function (value) {
          value && alert('You have entered: ' + value);
        }
      });
    });
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

As noted in the documentation, you can provide the initial value for a prompt using the value option:

$(document).on('click', '.update', function (e) {
    let button = $(this); /*Button that triggered the modal*/
    let name = button.data('name');
    
    bootbox.prompt({
        title: 'Enter Description',
        placeholder: 'my placeholder',

        value: name, /* this is the option you would use */

        buttons: {
          confirm: {
            label: 'Submit'
          }
        },
        callback: function (value) {
          value && alert('You have entered: ' + value);
        }
    });
});
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!