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

    I have a site where we use Jot to post comments. However, we do not want to allow empty comments to be posted. In this case the comment form should report an error like it does if an email validation fails etc.

    I have tried adding this validation like I do with custom fields but it does not work, as the content field does not seem to be treated the same way as other custom fields.

    Does somebody have a suggestion how this can be done.

    Best Regards
    Niels
      • 1122
      • 209 Posts
      Here goes the requested suggestion:
      &validate=`content:Your comment should be at least 10 chars long:/^.{10}/`
      

      Validation of the content field is done with a regular expression that requires the content to have at least 10 characters. If you plan to improve my RE, please remember to avoid comma character in it (comma is used by Jot itself to separate entire validation strings within &validate parameter).