SOLVED

Styling the dropdown field

Go to solution
FrizzyBrain
Level 2

Styling the dropdown field

Hello everyone,

 

Our forms are being embedded on our page. Now we are wanting to change the style of the marketo dropdown field to follow out Brand design scheme. We have partially been successful, as we were able to change the field. The issue that we are facing right now is when the dropdown field is in an open state, the container around the <option> tags look different. We have tried many ways to change this, is there any suggestions how to tackle this issue?

 

Below are images viewed on a desktop and on Edge:

FrizzyBrain_1-1678331899782.pngFrizzyBrain_2-1678331917876.png

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Styling the dropdown field

Well, that isn’t an HTML <select>!

 

It’s a custom set of <div>s created from the HTML <select> (which is then hidden) using your site’s custom JS. So naturally it has a lot more styleability. Although it also doesn’t function exactly like a real Select (it lacks typeahead, for example).

View solution in original post

SanfordWhiteman
Level 10 - Community Moderator

Re: Styling the dropdown field


it's not possible to manipulate the <select> tag fully, is there a system configuration that we can do in Adobe Marketo's Form settings to change that <select> tag to a <div> tag?

Certainly not! <div> elements aren’t form inputs, and Marketo uses real inputs, as all forms libraries should.

 

Other elements — leaving aside future form-associated custom elements, which aren’t supported in all browsers yet — aren’t part of the form.

 

Obviously you could inject a fake form element and link it to a hidden real input, which is how “enhanced“ form widgets work. You can’t replace the real input with a fake input.

View solution in original post

13 REPLIES 13
SanfordWhiteman
Level 10 - Community Moderator

Re: Styling the dropdown field

Please link to your page so we can inspect your code. Can't troubleshoot a screenshot.

FrizzyBrain
Level 2

Re: Styling the dropdown field

Hey @SanfordWhiteman,

 

Here you go:  <link removed>.

SanfordWhiteman
Level 10 - Community Moderator

Re: Styling the dropdown field

Not sure what you mean by "different"? Is it that the options go bottom-up? That's because of the height of the page, the browser chooses the best direction automatically.

 

The custom fieldset-style look of the <select> label vs. the <input type="text"> labels looks to be the same.

 

SanfordWhiteman_0-1678393558946.png   SanfordWhiteman_1-1678393576783.png

 

Or are you referring to the fact that your JS leaves the top option's inner text empty when it's open? Please be specific about the discrepancy.

 

 

 

FrizzyBrain
Level 2

Re: Styling the dropdown field

We want the dropdown field (open state) to look like this design scheme:

 

FrizzyBrain_2-1678399551481.png

 

FrizzyBrain_3-1678399561218.png

 

As you can see from the design scheme vs current, the container around the <option> tags in the design scheme is different. Is there a way to make the current dropdown field to look like our design scheme?

SanfordWhiteman
Level 10 - Community Moderator

Re: Styling the dropdown field

Where is the top screenshot from? Please link to the page where this is implemented.

FrizzyBrain
Level 2

Re: Styling the dropdown field

Hey @SanfordWhiteman,

 

Apologies, here you go (click on the contact-us button): <link removed>

SanfordWhiteman
Level 10 - Community Moderator

Re: Styling the dropdown field

Well, that isn’t an HTML <select>!

 

It’s a custom set of <div>s created from the HTML <select> (which is then hidden) using your site’s custom JS. So naturally it has a lot more styleability. Although it also doesn’t function exactly like a real Select (it lacks typeahead, for example).

FrizzyBrain
Level 2

Re: Styling the dropdown field

Hey @SanfordWhiteman,

 

Yes, I know it's imitating a <select> dropdown field. It's using a <div> tag. What I want to know is, are we able to style a <select> tag like how they've styled the <div> tag? Is it possible? The issue we are facing is not being able to style the container around the <option> tags. 

SanfordWhiteman
Level 10 - Community Moderator

Re: Styling the dropdown field

No, a real <select> cannot be made to look exactly like that fake <select>. Using the correct semantic element means you have more limited styling ability.