I'm developing a chrome extension with an options screen. It contains a 10x5 grid form input and I'm trying to get the fields to autofocus to the next one as the user enters data. I followed the code listed on this question: Using Javascript to Auto move cursor onto next form field
However, when I load the extension the focus to next field doesn't work when I click on options under the extension. When I load the options.html file by itself then the focus functions work just fine. Somehow the function to focus doesn't work within the options screen in Chrome but does when I just load the html file by itself.
Is there something special about the Chrome options screen that prevents the focus from working?
Code samples: options.html
<td><input type="text" size="1" maxlength="1" id="A1" onkeyup="moveOnMax(this,document.getElementById('B1'))" autofocus></td>
<td><input type="text" size="1" maxlength="1" id="B1" onkeyup="moveOnMax(this,document.getElementById('C1'))"></td>
<td><input type="text" size="1" maxlength="1" id="C1"></td>
<td><input type="text" size="1" maxlength="1" id="D1"></td>
The script is also in the html form for right now:
<script language="javascript" type="text/javascript">
function moveOnMax(field, nextFieldID) {
if (field.value.length >= field.maxLength) {
nextFieldID.focus();
}
}
</script>