Prevent first field from getting focus

Dec 2, 2015 at 11:09 AM
Hi Sacha,

The first field of the form always gets focused on page load.
It's very confusing if the form is in the footer - the page always scrolls down.

If I put 2 forms on the same page it's like playing lottery which one will gain focus ;)

What is the best way to prevent OpenForm to get focused initially.

Thanks,
St.
Coordinator
Dec 2, 2015 at 1:50 PM
Hi,

You can set in the options.json (UI Options in Edtit template files)

"focus" : ""
Example :
{
  "focus" : "",
  "fields": {
    "Email": {
      "type": "email"
    },
    "Message": {
      "type": "textarea"
    }
  }
}
Regards,
Sacha
Marked as answer by stef4620 on 12/4/2015 at 12:36 PM
Dec 2, 2015 at 6:15 PM
Thank you,

It did the trick.
It's really hard to find something particular on alpaca website.

Regards,
St.
Mar 27 at 7:15 AM
Hello,

How do we accomplish this once the form is converted to use form builder? I needed to add an additional field, so had to enable form builder. After I did that I no longer see an option for UI options in the template files.

Thanks
Mar 29 at 3:51 AM
FYI.

In case anyone has the same issue I did, the fix proposed by Sacha does work, however you can't access the options.json via the module. You have to access the file directly in the file system (Portals/[PortalNum]/OpenForm/Templates/Contact)