className is putting class in the wrapper but not the input itself

className is putting class in the wrapper but not the input itself

cfprogrammercfprogrammer Posts: 8Questions: 3Answers: 0

Is there a way do get editor to place the class directly on the input instead of the wrapper?

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Yes, use the attr option which is available for each field type. It will set attributes on the input element:

    {
      label: "My field:",
      name: "myField",
      attr: {
        "class": "myClass"
      }
    }
    

    You could also use field().input() which provides the input element as a jQuery object.

    Allan

This discussion has been closed.