def search_advanced_view(request, tag_id=None):

    if request.method == 'POST':
        form = AdvancedSearchForm(request.POST)
        if form.is_valid():
            urlparams = request.POST.copy()
            # delete these from params as not required
            del urlparams['csrfmiddlewaretoken']
            del urlparams['submit']
            return HttpResponseRedirect(reverse('orb_search_advanced_results') + "?" + urlparams.urlencode())
    else:
        form = AdvancedSearchForm()

    return render(request, 'orb/search_advanced.html', {'form': form})