<form id="save-as-filter-form" method="post" action="<%= ApplicationController.root_context -%>/measures/save_as">
  <input type="hidden" name="id" value="<%= @filter.id -%>">
  <input type="hidden" name="data" value="<%= u(@filter.data) -%>">
  <fieldset>
    <div class="modal-head">
      <h2>Save Filter</h2>
    </div>

    <%= render :partial => 'shared_form' %>

    <div class="modal-foot">
      <input type="submit" value="<%= h message('save') -%>" id="save-as-submit"/>
      <a href="#" onclick="return closeModalWindow()" id="save-as-cancel"><%= h message('cancel') -%></a>
    </div>
  </fieldset>
</form>
<script>
  $j("#save-as-filter-form").modalForm({success:function (data) {
    window.location = baseUrl + '/measures/filter/' + data;
  }});
</script>