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

    How can i save my custom fields like check box, combo boxes and text-fields in database using in "New Article". I have two check boxes right now and i want to save value of them in database. These check boxes are added in form using create.js (assests/components/articles/js/article/create.js) using following code:

    {
    xtype: 'xcheckbox'
    ,name: 'breakingNews'
    ,fieldLabel: "Breaking News"
    ,id: 'breaking-news'
    ,value: 1
    ,checked:false
    },
    {
    xtype: 'xcheckbox'
    ,name: 'liveNews'
    ,fieldLabel: "Live News"
    ,id: 'live-news'
    ,value: 1
    ,checked:false
    },

    Please check attachment...

    Thnx
      • 4172
      • 5,888 Posts
      can't you just use checkbox - Template-Variables here?
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 48305
        • 58 Posts
        Can you write steps and files where i change and save data on submission of form... cause i have problem in saving to db...

        thnx
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          What Bruno was saying is, instead of modifying the article's editing form, just use a TV. Or I was thinking, just use a tag, since that is already part of the form.
            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
            • 48305
            • 58 Posts
            @sottwell ,

            Kindly check attachment, may it helps....
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              Yes, I know. The question is, do you need to actually create new fields in the form and in the database? And, of course, such modification of the Articles extra means you would have a problem any time you upgrade.

              Instead, you could use a TV. Or, you could use the existing Tags field. A tag of "breaking" and/or "live" would do the trick. Use it in the output listing snippets like any other tag, or TV filter if you were using a TV.
                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
                • 48305
                • 58 Posts
                Ok I am trying, actually the requirement is , when any article is post if admin checked "Breaking NEWS" then that article will show as breaking news, i have created fields in table with news_flag breaking_news=1 and live_news=2,

                So, when i submit my form, i want these values set again that column. That is requirement.

                Can you track me files or location where i should apply changes?

                Thnx