Focusing on last textfield in twitter bootstrap modal form when pressing tab
I observed that in Twitter bootstrap modal form, tab key was not focusing on the last element when the focus in on second last element and tab key is pressed.
Found this workaround to resolve
$('#billingInfo').keydown(function(e){
if($('#buyerPincode').is(":focus") && (e.which || e.keyCode) == 9){
e.preventDefault();
$('#buyerPhoneNumber').focus();
}
#billingInfo -> ID of the twitter bootstrap modal form
#buyerPincode-> ID of second last element
#buyerPhoneNumber->ID of last element in the form.
keyCode=>9 is the keycode for tab key
I observed that in Twitter bootstrap modal form, tab key was not focusing on the last element when the focus in on second last element and tab key is pressed.
Found this workaround to resolve
$('#billingInfo').keydown(function(e){
if($('#buyerPincode').is(":focus") && (e.which || e.keyCode) == 9){
e.preventDefault();
$('#buyerPhoneNumber').focus();
}
#billingInfo -> ID of the twitter bootstrap modal form
#buyerPincode-> ID of second last element
#buyerPhoneNumber->ID of last element in the form.
keyCode=>9 is the keycode for tab key