Database User Input Form: Arranging tab order.

When user is entering data into user input database form, the form is tabbing vertically. How can I make it tab horizontally and then vertically?

1 Like

I don’t think you can do that - That’s a #FeatureRequest :frowning:

How is everyone else dealing with this? Right now when the tab key is hit, it tabs to random fields. I’ve never seen this happen before.

There is ‘a kind of’ workaround for this

Suppose you have a primary input element with the ID as input1 & you have 2 more input elements with the IDs as input2 & input3 respectively.

Now while you are typing something in input1 and you hit the ‘Tab’ key the focus jumps from input1 to input2 but you don’t want it that way. Instead when someone hits the ‘Tab’ key on input1 you want them to land on input3

If your input2 element is ‘required’ then use this code

export function input1_keyPress(event) {
 if(event.key === 'Tab') {
        $w("#input3").focus();
        resetFields();
    }
}
function resetFields() {
    setTimeout(() => {
        $w("#input2").resetValidityIndication(); //the delay because .focus() and this one are promises
    }, 200);
}

Else if input2 is not ‘required’ then use this

export function input1_keyPress(event) {
 if(event.key === 'Tab') {
        $w("#input3").focus();
    }
}