• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Custom Profile Field - Callback for member_autocomplete


Active member
Hello! And thanks for looking at this

I'd like to add "Referrer" to my registration, is there a php callback I can use to do the "member_autocomplete" so they don't have to know how to spell the username?

Edit: I am guessing the callback is executed when the field validates, in which case I would need to check if the person exists.

Thanks in advance,


Update: I figured it out myself.

I added a enum directly in the sql table for xf_user_field for type "usersearch"

then on the custom referrer field, I went in and changed the type manually in phpmyadmin to "usersearch" that I just added the enum to, then....

one simple edit on "custom_field_edit" added the green lines (well I guess I can't add green to the HTML/CODE tags... Anyways, its the field_type usersearch block

<xen:elseif is="{$field.field_type} == 'textarea'" />
            <textarea name="custom_fields[{$field.field_id}]"
                class="textCtrl Elastic">{$field.field_value}</textarea>
        <xen:elseif is="{$field.field_type} == 'usersearch'" />
            <input type="search" name="custom_fields[{$field.field_id}]"
            placeholder="{xen:phrase name}..." results="0" class="textCtrl AutoComplete"
            data-autoSubmit="true" />
        <xen:elseif is="{$field.field_type} == 'radio'" />
Last edited: