Add a CSS class to MktoForm field | Community
Skip to main content
Adobe Employee
June 20, 2017
Solved

Add a CSS class to MktoForm field

  • June 20, 2017
  • 1 reply
  • 6417 views

Related to this thread, I want to add an autocomplete feature to one of the fields to avoid a long select list.  I found this JS that will do the job... Awesomplete: Ultra lightweight, highly customizable, simple autocomplete, by Lea Verou

The trick is to add a class to the field (<input class="awesomplete" ...) but i don't see how to do that.  Any ideas?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman

Awesomplete has multiple methods of binding data lists to inputs.

The CSS class is the declarative method, and that isn't the best choice for forms libraries like Marketo's, which inject forms asynchronously into the page.

Instead, use the programmatic method, as shown here: MktoForms2 :: Awesomplete

1 reply

SanfordWhiteman
SanfordWhitemanAccepted solution
Level 10
June 20, 2017

Awesomplete has multiple methods of binding data lists to inputs.

The CSS class is the declarative method, and that isn't the best choice for forms libraries like Marketo's, which inject forms asynchronously into the page.

Instead, use the programmatic method, as shown here: MktoForms2 :: Awesomplete

Adobe Employee
June 20, 2017

Perfect! 

Just what I needed.  Thanks!

Adobe Employee
August 15, 2017

Is there a way to change the code and datalist, so I the user can pick their Full Name and Awesomplete will populate their First name, Last name, Email address, and Phone into hidden fields?