Question

Text placeholders

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

Like 0

Like

6 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.

where i have to write my input value?

1)Or enter the string resource on the page or enter directly (2nd option)

Localized strings and images are the resources of the client schema that are most often used in the implementation logic of the module.

Add resources to the client schema in the [Structure] tab of the client schema designer. The application core automatically generates a special [Client module name]Resources module, which contains resources of the client module. The localizableStrings property stores schema's localized strings. The images property stores image resources.

In order to access a resource module from a client module, you need to import the resource module as a dependency into the client module.

Use resource string:

"placeholder":{

                "bindTo": "Resources.Strings.Placeholder"

            },

2) directly

 "placeholder": "I'am empty"

 

Show all comments