Fork me on GitHub
Please upgrade to 2.1.x here. The 2.0 branch is no longer being updated.
You should grab 2.1.9, released 18 March. It's what all the cool kids are doing.

can we force people to ask question only in some category?

edited September 2011 in Vanilla 2.0 Help
This discussion is related to the Q&A addon.
Is that possible?


  • Or only post discussions in a fixed category - I am interested to have that feature, too.
  • Personally I would use CSS to hide the question/discussion choice of the QnA plugin. Then use javascript in the new post that selects the correct one of those options depending on which category you select in the dropdown.

    in the QnA js file you can see that it does this when you click one of the buttons to decide if you want to post a discussion or ask a question:

    $('input:radio[value='+$this.attr('rel')+']').attr('checked', 'checked');

    This should work if you place it in the qna.js file

    var cat = $(this).find('option:selected').text().replace(/[^a-zA-Z0-9]/,'');
    case 'Help':
    case 'Support':
    case 'IAskQuestionsHere':
    $('input:radio[value=Question]').attr('checked', 'checked');
    $('input:radio[value=Discussion]').attr('checked', 'checked');

    Note: In my forum I removed the |-> arrows on my dropdowns so for sanity sake when I get the string of the category I remove everything but letters and numbers. @!%!Show_Case becomes ShowCase in the case statement.
  • Hi @sbenes,

    Whereabouts in the qna.js do I drop the example above? I've tried outside of the jQuery section, inside the last }); and the second to last. Also the values of my drop down menu are numeric. Do I refer to this numeric value or the actual category name?
    Many thanks,
Sign In or Register to comment.