• Gamers

    I already created a custom field in the composer, and is working perfect. Now I want to add some validation, just like the one nodebb core has when you try to publish a topic without a title and you get this alert.


    How can trigger this same alert with a different message and avoid the composer to submit (until this field validates)?

  • NodeBB

    Use 'filter:composer.check'

    hooks.on('filter:composer.check', function (payload) {
         payload.error = 'sorry you can not post now';
         return payload;

Suggested Topics

  • 1
  • 3
  • 2
  • 4
  • 7
| |