Implemented Form.js Disabler - Add option to NOT autofocus

Snog

Well-known member
I know this might seem strange, but I have an application where the autofocus for the fields being revealed shouldn't happen. So, I'm wondering if an option could be added to the disabler?

Options in js: autofocus: true // if false, autofocus won't happen

js code:
Code:
if (this.options.autofocus)
{
    var cb = function () {
        XF.layoutChange();
        select();
    };
}
else
{
    var cb = function () {
        XF.layoutChange();
    };
}
I think that's correct and I have tested it to work. But you might want to double check it. ;)

Template option: data-autofocus="false";

Thanks!
 
Upvote 1
This suggestion has been implemented. Votes are no longer accepted.
Should this still be working in XF 2.3? I'm using it as shown below but the first input field still has autofocus applied.

HTML:
<xf:form action="{$link}" ajax="true" class="block" data-autofocus="false">
 
Back
Top Bottom