We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!

Answered Default value

    • 28042 ☆ A M B ☆
    • 24,524 Posts
    Is there a way to specify a default value for a form tab's field?

    This question has been answered by ottogal. See the first response.

    [ed. note: sottwell last edited this post 11 years, 8 months ago.]
      Studying MODX in the desert - http://sottwell.com
      Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
      Join the Slack Community - http://modx.org
      • 22427
      • 793 Posts
      Editing the field, you go to Input Options where you can set a default value.
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        What do you mean, "editing the field"? Where? In the formtab I have three fields, I want to set a default value for one of them.

        [
        {"caption":"Info", "fields": [
          {"field":"title","caption":"Title"},
          {"field":"description","caption":"Description","inputTVtype":"richtext"},
          {"field":"tpl","caption":"Template","inputTVtype":"textarea"} // I want a default value here
        ]},
        {"caption":"Image", "fields":[
            {"field":"image","caption":"Image","inputTVtype":"image","sourceFrom":"migx"}
        ]}
        ] 
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
        • discuss.answer
          • 22427
          • 793 Posts
          "Editing the field": I was thinking of MIGXdb, where I edit the Form Tabs in the package configuration.

          {"field":"tpl","caption":"Template","inputTVtype":"textarea"} // I want a default value here
          Did you try
          {"field":"tpl","caption":"Template","inputTVtype":"textarea","default":"wanted_value"}
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            That works. Thanks! [ed. note: sottwell last edited this post 11 years, 8 months ago.]
              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org