Oct 04, 2020 1:35 am
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
Oct 08, 2020 10:11 am
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.