Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- jQuery(document).ready(function( $ ) {
- // Function to set and lock the value
- function setAndLockSelectize() {
- var selectize = $('#bp-blog-category-select')[0].selectize;
- // Clear any previous selections
- selectize.clear();
- // Add and select the value '81'
- selectize.addOption({value: '81', text: 'Member Blog'});
- selectize.addItem('81');
- // Lock the selectize control to prevent user interaction
- selectize.lock();
- }
- // Check if Selectize is initialized
- if ($('#bp-blog-category-select').hasClass('selectized')) {
- setAndLockSelectize();
- } else {
- // Wait for Selectize to initialize
- $('#bp-blog-category-select').one('selectize:initialize', function() {
- setAndLockSelectize();
- });
- }
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement