itadhkbn
11 years agoGuide
Hide the "Show All" option
I want to limit the users to post new topic within the same category. But I found that when the user click the "Show All" option, they can select the boards at the other category. How can I hid...
- 11 years ago
Hi itadhkbn ,
in one of my projects, I used JavaScript to remove the "show all", just create a component with the following JavaScript code and add it to PostPage.
<@liaAddScript> .... .... function removeShowAll () { var boardObj = document.getElementById('lia-board'); for(var i=0; i < boardObj.options.length; i++) { if(boardObj.options[i].value == "$more$" ) { boardObj.remove(i); return true; } } } </@liaAddScript>
be careful with this removal, as the dropdown list shows 20 boards, you can't see all boards there if you have more than 20 boards, you may consider to increase the number under
Admin->features->ask a question->number of boards to display
- 11 years ago
Hi Haidong. Thanks for your reply.
FYI. I have used the below code to hide the option.
<script type="text/javascript">
if ($("#lia-board option:last").val()=="$more$"){
$("#lia-board option[value='$more$']").remove();
}
</script>