I am trying to set focus to the next input element in a table when onkeyup event is triggered, much similar to the functionality as stated here
<table>
<tr>
<ui:repeat value="#{alphabets}" var="alphabet">
<td>
<h:inputText value="#{alphabet.value}" onkeyup="jumpNext(this)" />
</td>
</ui:repeat>
</tr>
</table>
The script $(input).next("input[type=text]").focus(); is not working if input elements are inside the table. And i also tried the following script
$(input).closest('td').next('td').find('input[type=text]').focus(); but couldn’t able to get the expected behavior.
How to do this?
I would use:
If you don’t have other inputs don’t bother filtering by type