View Full Version : [HOW TO - vB 4.x] Adding Username Suggestion Dropdown

29 Mar 2010, 15:28
This is a tutorial to show you how to add the username suggestion dropdown to your form as seen in image below.


Add to the <head> of your template
<script type="text/javascript" src="clientscript/vbulletin_ajax_suggest.js?v={vb:raw vboptions.simpleversion}"></script>
<script type="text/javascript">
function setAjax()

if (document.getElementById('userfield'))
snc = new vB_AJAX_NameSuggest('snc', 'userfield_txt', 'userfield');
Find and replace the <body> tag in your template with:
<body onload="setAjax()">
Add to your template where you want the username:
<div class="blockrow">
<label for="userfield_txt">{vb:rawphrase username}</label>
<ul class="multifield group">
<div id="userfield" class="popupmenu nomouseover noclick nohovermenu">
<input type="text" class="textbox popupctrl" name="username" id="userfield_txt" tabindex="1" />