Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
895 views
in Q2A Core by

I could not find this option in the admin panel (and no plugin for that), so I used jquery to not let the user send his question if there are NO tags.

use this jquery code:

// user must give at least 2 tags
if ($("#tags").length > 0){
    var regForm = $(".qa-form-tall-table").parent();
    regForm.submit(function(e) {
        var tagsN = 0;
        // count nr of tags
        var matches = $("#tags").val().match(/\b/g);
        if(matches) { tagsN = matches.length*0.5; }
        if(tagsN<2) {
            e.preventDefault();
            $("#tags").focus();
            $("#tags").css("background-color","#FFFFAA");
            alert("Please give 2 tags related to your question!");
            return false;
        }
        return true;
    });
}





 

1 Answer

+4 votes
by
selected by
 
Best answer
Actually there is an option for that. Check in Admin > Posting, there are options for minimum/maximum number of tags.
by
thanks, is new to me!
by
dear scott after select number of tag
is user able to post question without tags?
by
If you set a minimum of 1 tag, they cannot post without tags, there must be at least 1 tag.
by
thanks ..... for this now in NoahY q2a-history plugin notification bubble not show in right side of user name please help me how to show this...
...