Answers for "How to Set focus to first text input in a bootstrap modal after shown"

0

To focus on the textbox when bootstrap pop-up is open

$("#dialog-cancelReasonModal").on('shown.bs.modal', function () {
                $(this).find('#txtName').focus();
            });

•	ID of the bootstrap POP-UP = dialog-cancelReasonModal 
•	ID of the TextBox = 'txtName'
Posted by: Guest on May-07-2020
0

How to Set focus to first text input in a bootstrap modal after shown

$('#myModal').on('shown.bs.modal', function () {
    $('#textareaID').focus();
})  

/* My solutioin .. 
// focus on button close .. so when you press Enter key .. modal closes .. again comunicating with bs.modal only attainable by jq
			$(ids.id4).on(`shown.bs.modal`, function(){
				$(`#modal-diag1 button`).focus()
			})
  ==============================================================
  // check the following for 
  $("#dialog-cancelReasonModal").on('shown.bs.modal', function () {
                $(this).find('#txtName').focus();
            });

•	ID of the bootstrap POP-UP = dialog-cancelReasonModal 
•	ID of the TextBox = 'txtName'
Posted by: Guest on November-26-2020
0

How to Set focus to first text input in a bootstrap modal after shown

<input value="" autofocus>
 // not tested yet
// https://stackoverflow.com/questions/15247849/how-to-set-focus-to-first-text-input-in-a-bootstrap-modal-after-shown
Posted by: Guest on November-26-2020

Code answers related to "How to Set focus to first text input in a bootstrap modal after shown"

Browse Popular Code Answers by Language