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);
}
});
});
As noted in the documentation, you can provide the initial value for a prompt using the
valueoption: