This project has moved and is read-only. For the latest updates, please go here.

Prevent first field from getting focus

Dec 2, 2015 at 12:09 PM
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.

Dec 2, 2015 at 2:50 PM

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

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

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

Mar 27 at 8:15 AM

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.

Mar 29 at 4:51 AM

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)