Question

Text placeholders

Is it possible to set up text placeholder for textareas without querying the DOM and applying it manually?

Like

4 comments

Could you, please describe your case in more details?  Also, any examples/screenshots will be appreciated

Tetiana Markova,

When I have a text field like this:

I want to have some text inside it while the user has not filled it yet, like when using standard placeholder attribute on an input field:

Carlos,

Thank you for your specification.
You need to define "placeholder" property for your element in the diff array. Please, see my example for JobTitle field in the ContactPageV2 schema:
{
    "operation": "merge",
    "parentName": "ProfileContainer",
    "propertyName": "items",
    "name": "JobTitleProfile",
    "values": {
        "bindTo": "JobTitle",
        "controlConfig": {
            "className": "Terrasoft.TextEdit",
            "placeholder":{
                "bindTo": "Resources.Strings.Placeholder"
            },
            "classes": ["placeholderOpacity"]
        }
    }
}
You can also find other examples in the base packages.

 

Tetiana Markova,

Thank you very much, it works nicely.

Log in or register to comment