Notifications
Clear all

Limited Support

Our support team is currently on holiday from December 25, 2025 to January 7, 2026, and replies may be delayed during this period.

We appreciate your patience and understanding while our team is away. Thank you for being part of the wpForo community!

Merry Christmas and Happy Holidays! 🎄

wpForo 1.x.x [Solved] What JQuery can make Tags a required field in the Add-Topic form, when ID keeps changing?

2 Posts
2 Users
1 Reactions
1,614 Views
Posts: 127
Topic starter
(@mplusplus)
Reputable Member
Joined: 6 years ago

Hi there

I see that in the Add Topic form, the ID of the Tags input element keeps changing. So, what JQuery code can make it a required field, please?

I tried this but it did not work.

$.wpf_tags.attr("required", true);

Thanks.


1 Reply
Alvina
Posts: 1860
Moderator
(@alvina)
Member
Joined: 6 years ago

Hi @mplusplus,

Please try the following JS code:

function wpfcf_make_tags_required(){
jQuery('form[data-textareaid] input[id^=wpf_tags_]').prop('required', true);
}
jQuery(document).ready(wpfcf_make_tags_required);
document.addEventListener('wpforo_topic_portable_form', wpfcf_make_tags_required);

The code should be added in the current active theme JS  files.