Forums

How to clear a field on Focus?

HerKle 18 Jun, 2019
Hi again,

when a field is focused by the user, I want the default value to vanish.

I tried and entered the following into "extra params" of a text field:
onfocus=if(this.value == 'First name*') { this.value = ''; }
Unfortunately, this didn't work. What's wrong with my syntax?
Thx for showing me a way!
Herbert
healyhatman 18 Jun, 2019
Answer
Why not use the placeholder if that's the behaviour you're after?

Also attribute:value

So onfocus:blahblahblah
HerKle 18 Jun, 2019
The "placeholder" seems to be not documented - so I don't know anything about its purpose. I always use three ways to find out more about ChronoForms before asking stupid questions:

1. Click on "More info on Chronoengine.com" when editing a field on my site: this opens 404 Error page on Chronoengine.com (since a couple of months - it used to work before a date X).
2. Searching for "placeholder" on Chronoengine FAQs' site: shows empty page (empty page is btw the result of any search term)
3. Searching for "placeholder" with CF5 tag in Chronoengine forum: no results.

It's a pity that two of three ways don't work properly here. I am sure the info is available here somewhere.
Regard, Herbert
HerKle 18 Jun, 2019
But filling placeholder did the trick. Thx, healyhatman.
healyhatman 18 Jun, 2019
No problem. And placeholder is a standard html attribute so I'm not surprised there isn't a page teaching you about it here.
GreyHead 19 Jun, 2019
Hi Herbert,

The Forum search herehas been broken for a while :-( hopefully Max has it on his 'to-do' list to fix it.

I use Google search which is usually better anyhow. Putting site:chronoengine.com placeholder in my browser takes me to this list of posts and FAQS

Bob
This topic is locked and no more replies can be posted.