Question T7838
Visible to All Users

DefaultValue in TextField does not work

created 3 years ago

Hello

I added an input of type "Text" with default value like "01/01/2022", the creator's preview displays correctly my default value but in the survey form, my input is still empty, see attached screenshots and below my JSON:

JSON
{ "pages": [ { "name": "page1", "elements": [ { "type": "text", "name": "question1", "defaultValue": "01/01/2022" }, { "type": "checkbox", "name": "question2", "choices": [ "item1", "item2", "item3" ] }, { "type": "dropdown", "name": "question3", "choices": [ "item1", "item2", "item3" ], "choicesByUrl": { "url": "/api/countries" } } ] } ] }

Many thanks for your help

Answers approved by surveyjs Support

created 3 years ago

Hello,
Unfortunately, I could not reproduce the issue. Here is the example.
What version and platform do you use?

Thank you,
Andrew
SurveyJS Team

    Comments (3)

      Thanks Andrew, but we are using the angular library v11 not react

        It is a basic functionality and we test it for all framework. There are unit and functional tests.
        Here is an angular example.
        You are probably using an old version or there is a code in your survey events handlers that changed the survey behavior.

        Thank you,
        Andrew
        SurveyJS Team

          Thank you Andrew, so we will investigate more our code.

          Many thanks