Twitter bootstrap modal input field focus
For a general solution that doesn't require specific code for each dialog, you can use this:
$('.modal').on('shown.bs.modal', function () { $(this).find('input:text:visible:first').focus();})
Try removing tabindex="-1"
and it works nice.
So change this:
<div class="modal fade" id="modalID" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
To this:
<div class="modal fade" id="modalID" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">