Contents

messages_autocomplete_init_jsblock()

Print inline JS for initializing the messages autocomplete.

Description

Source

File: bp-messages/bp-messages-cssjs.php

function messages_autocomplete_init_jsblock() {
?>

	<script>
		jQuery(document).ready(function() {
			var acfb = jQuery("ul.first").autoCompletefb({urlLookup: ajaxurl});

			jQuery('#send_message_form').submit( function() {
				var users = document.getElementById('send-to-usernames').className;
				document.getElementById('send-to-usernames').value = String(users);
			});
		});
	</script>

<?php
}

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.