[HOW TO - vB 4.x] Adding Username Suggestion Dropdown
by
29 Mar 2010
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
HTML Code:
<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');
}
}
</script>
- Find and replace the <body> tag in your template with:
HTML Code:
<body onload="setAjax()">
- Add to your template where you want the username:
HTML Code:
<div class="blockrow">
<label for="userfield_txt">{vb:rawphrase username}</label>
<ul class="multifield group">
<li>
<div id="userfield" class="popupmenu nomouseover noclick nohovermenu">
<input type="text" class="textbox popupctrl" name="username" id="userfield_txt" tabindex="1" />
</div>
</li>
</ul>
</div>
|