SOLVED

Display form label when text is within field

Go to solution
Tim_Marcacci
Level 2

Hi everyone,

I'm trying to build out a form where the labels hidden until a user types into that field and the label then appears above. Below is a screenshot of what I'm trying to do. The hint text is in place and everything is styled and good to go, I am just not familiar enough with javascript to get this to work (I'm assuming its a javascript solution?). Note that this needs to happen on a per-field basis. I don't want all field to appear when you start typing into just 1 field. Sanford Whiteman​, I know you're the go-to guy with this sort of javascript question.

Screen Shot 2018-11-22 at 7.04.33 AM.png

Any help would be great!

Thanks,

Tim

1 ACCEPTED SOLUTION
SanfordWhiteman
Level 10 - Community Moderator

Y'left out one important case with Marketo forms.

Also, you need only listen for the input event to cover both key events and clipboard events. See

     MktoForms2 :: Floating Labels (tmarcacci)

which is tested back to IE 10.

Also, note to Tim: the placeholders aren't great in IE 10-11 because they're the same white color as user-entered text:

pastedImage_0.png

View solution in original post

23 REPLIES 23
Tim_Marcacci
Level 2

Not to my knowledge. But to be frank, that is a bit above my understanding.

SanfordWhiteman
Level 10 - Community Moderator

It looks like you are. Should be using Form Pre-Fill. External sites. No limits. You're welcome.

Tim_Marcacci
Level 2

Thanks Sanford. I'll have to dive into this very soon.