Jump to content

Make message required for reporting a post


Go to solution Solved by Daniel F,

Recommended Posts

Posted

Apologies for the novice question, I'm slowly coming up to speed on using the developer tools to customize our site.

We find we get a lot of reported posts without a supplied reason, so want to make that field required. I've created a theme hook and believe I have found here the report dialog is initiated

<li class="ipsMenu_item">
<a href="" data-ipsdialog="" data-ipsdialog-remotesubmit="" data-ipsdialog-size="medium" data-ipsdialog-flashmessage="" data-ipsdialog-title="{lang="report_post"}" data-action="reportComment" title="">
{lang="report"}
</a>
</li>

under \IPS\Theme\class_forums_front_topics

However, it's not terribly obvious how I go about making the message required before "Submit Report" will function. I've spent quite a bit of time reading the dev docs and searching this whole community for "required field" and other terms, to no avail.

I assume we'll also need to edit the language file for report_message_placeholder, as "Optionally enter a message with your report." obviously no longer makes sense.

Any help appreciated.

  • Solution
Posted
On 3/26/2021 at 4:43 PM, rllmukforum said:

However, it's not terribly obvious how I go about making the message required before "Submit Report" will function. I've spent quite a bit of time reading the dev docs and searching this whole community for "required field" and other terms, to no avail.

Almost all form fields are handled via Form Helpers so if you need to change any of these fields, you'll have to search for the method which creates the form, then you can create a hook to change the form fields!

There are few methods where above approach won't work, in this case you can create a hook on \IPS\Helpers\Form\FormAbstract to override the constructor to adjust the field data 🙂 

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...