'Render this filter form as HTML form.
@param resource: the S3Resource
@param get_vars: the request GET vars (URL query dict)
@param target: the HTML element ID of the target object for
this filter form (e.g. a datatable)
@param alias: the resource alias to use in widgets'

def html(self, resource, get_vars=None, target=None, alias=None):

    attr = self.attr
    form_id = attr.get('_id')
    if (not form_id):
        form_id = 'filter-form'
    attr['_id'] = form_id
    attr['_autocomplete'] = 'off'
    opts_get = self.opts.get
    settings = current.deployment_settings
    formstyle = opts_get('formstyle', None)
    if (not formstyle):
        formstyle = settings.get_ui_filter_formstyle()
    rows = self._render_widgets(resource, get_vars=(get_vars or {}), alias=alias, formstyle=formstyle)
    controls = self._render_controls(resource)
    if controls:
        rows.append(formstyle(None, '', controls, ''))
    ajax = opts_get('ajax', False)
    submit = opts_get('submit', False)
    if submit:
        auto_submit = settings.get_ui_filter_auto_submit()
        if (auto_submit and opts_get('auto_submit', True)):
            script = ("S3.search.filterFormAutoSubmit('%s',%s)" % (form_id, auto_submit))
            current.response.s3.jquery_ready.append(script)
        _class = None
        if (submit is True):
            label = current.T('Search')
        elif isinstance(submit, (list, tuple)):
            (label, _class) = submit
        else:
            label = submit
        submit_button = INPUT(_type='button', _value=label, _class='filter-submit')
        if _class:
            submit_button.add_class(_class)
        submit_url = opts_get('url', URL(vars={}))
        ajax_url = opts_get('ajaxurl', URL(args=['filter.options'], vars={}))
        submit = TAG[''](submit_button, INPUT(_type='hidden', _class='filter-ajax-url', _value=ajax_url), INPUT(_type='hidden', _class='filter-submit-url', _value=submit_url))
        if (ajax and target):
            submit.append(INPUT(_type='hidden', _class='filter-submit-target', _value=target))
        submit_row = formstyle(None, '', submit, '')
        if (auto_submit and hasattr(submit_row, 'add_class')):
            submit_row.add_class('hide')
        rows.append(submit_row)
    fm = settings.get_search_filter_manager()
    if (fm and opts_get('filter_manager', (resource is not None))):
        filter_manager = self._render_filters(resource, form_id)
        if filter_manager:
            fmrow = formstyle(None, '', filter_manager, '')
            if hasattr(fmrow, 'add_class'):
                fmrow.add_class('hide    filter-manager-row')
            rows.append(fmrow)
    if rows:
        elements = rows[0]
        if (not isinstance(elements, (list, tuple))):
            elements = elements.elements()
        n = len(elements)
        if (((n > 0) and (elements[0].tag == 'tr')) or ((n > 1) and (elements[0].tag == '') and (elements[1].tag == 'tr'))):
            form = FORM(TABLE(TBODY(rows)), **attr)
        else:
            form = FORM(DIV(rows), **attr)
            if (settings.ui.formstyle == 'bootstrap'):
                form.add_class('form-horizontal')
        form.add_class('filter-form')
        if ajax:
            form.add_class('filter-ajax')
    else:
        return ''
    form.formstyle = formstyle
    return form
