Expand my Community achievements bar.

SOLVED

Text field value remove after click

Avatar

Level 5

There is a text field with value "type your name". When click in text field, value will be automatically removed. One types "Adobe" and then click out side. If one wishes again type "cycle" after "Adobe" (not remove Adobe or retype "adobe")

Is it possible? How can I get it?

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

The other way to achieve this is to go to the Object > Field palette and set a display pattern for the null state.

See page 2 of the example form here: http://assure.ly/ewrLMo.

At its most basic it does not require script:

Parallels Desktop1.png

In our example we have script in the enter and exit events to change the font, but this is completely optional.

Hope that helps,

Niall

View solution in original post

4 Replies

Avatar

Level 2

Hi,

In the "enter" event of the textbox use following code with javascript;

if (this.rawValue == "type your name"){
this.rawValue = "";
}

In the "exit" event of the textbox use following code with javascript;

if (this.rawValue == null){
this.rawValue = "type your name";
}

Enjoy

Avatar

Correct answer by
Level 10

Hi,

The other way to achieve this is to go to the Object > Field palette and set a display pattern for the null state.

See page 2 of the example form here: http://assure.ly/ewrLMo.

At its most basic it does not require script:

Parallels Desktop1.png

In our example we have script in the enter and exit events to change the font, but this is completely optional.

Hope that helps,

Niall

Avatar

Level 2

Niall,

Now I finally know what that field is for!!

Real impressive.

Avatar

Level 5

Thanks both.

Bamboomania!

I placed those code but when I click in field, value was not removed automatically. Can I promote this code any way? Again thank you

Hi Niall O'Donovan!

Your answer is perfect.