In my last post, I wrote about assigning default values to fields. A field with a default value is not initially empty, but pre-filled. If a user leaves the field unchanged, the default value is saved as part of the entry data.
Today, I’ll discuss another kind of initial pre-filled information—the prompt value.
A prompt in a field is text which is not a value, but rather a suggestion or form of encouragement to fill the field. For example, in the:
field, the text “np. Filona 16, 02-658 Warszawa” is there just for encouragement and it doesn’t constitute a pre-defined field value. When a user clicks on the field, the suggestion will be cleared.
A field with encouraging text is treated as an empty one. If the field is required, and a user doesn’t fill it in (leaving the encouraging text), ActiveForms will return a validation error.
Apart from text fields, prompt values can also be found in drop-down list fields. A prompt in those fields is an additional, first option on the list with some generic (‘–Select–’) or more contextual (‘Select a product’, ‘Anytime’) text.
Encouraging text can often be used instead of field labels. This works particularly well with short and simple forms, especially when the graphic design doesn’t leave a lot of room for presenting labels: