<div xmlns="http://www.w3.org/1999/xhtml"
     xmlns:py="http://genshi.edgewall.org/">
  <input type="text" id="$name" name="$name" class="ui-autocomplete-input${className and ' %s' % className or ''}" value="$value"/>
  <script type="text/javascript">
    $(window).load(function(){
      $(document.getElementById("$name")).autocomplete({
        source: function(request, response) {
          $.ajax({
            url: "${'%suser_search' % c.project.url()}",
            dataType: "json",
            data: {
              term: request.term
            },
            success: function(data) {
              response(data.users);
            }
          });
        },
        minLength: 2
      });
    });
  </script>

</div>