I have the following html to receive 2 or more telephone numbers
<div data-bind="foreach: Telephones" id="Telephones">
<div class="inlinediv">
<input maxlength="3" size="3" type ="text" data-bind="value: Prefixe" class="tab1 no-margin" style="width: 40px;" />
<input maxlength="3" size="3" type ="text" data-bind="value: Telephone" class="tab2 no-margin" style="width: 40px;" />
<input maxlength="4" size="4" type ="text" data-bind="value: Suffixe" class="tab3 no-margin" style="width: 60px;" />
</div>
<div class="inlinediv">
<input maxlength="3" size="3" type ="text" data-bind="value: Prefixe" class="tab1 no-margin" style="width: 40px;" />
<input maxlength="3" size="3" type ="text" data-bind="value: Telephone" class="tab2 no-margin" style="width: 40px;" />
<input maxlength="4" size="4" type ="text" data-bind="value: Suffixe" class="tab3 no-margin" style="width: 60px;" />
</div>
</div>
I am using the autotab library to type in the number without tabbing.
$("#Telephones .tab1").autotab({ target: $("#Telephones .tab1").next("#Telephones .tab2"), format: "numeric" });
$("#Telephones .tab2").autotab({ previous: $("#Telephones .tab1"), target: $("#Telephones .tab2").next("#Telephones .tab3"), format: "numeric" });
$("#Telephones .tab3").autotab({ previous: $("#Telephones .tab2"), target: $("#Telephones .tab3").next().next("#Telephones .tab4"), format: "numeric" });
The problem I am having is that the tab seems to always go to the last "inlinediv" element, meaning the first input for the first number autotabs to the second element of the last phone number, second one in this case. I have a feeling I just need to modify my selector but Im not sure how to do it without using $(this) which does not seem to work with the autotab function.