{% extends "newbase.html" %}
{% load staticfiles %}
{% load rowerfilters %}

{% block title %}File loading{% endblock %}

{% block meta %}
<script type='text/javascript'
        src='https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js'>
</script>
<script type='text/javascript'
        src='https://ajax.aspnetcdn.com/ajax/jquery.validate/1.14.0/jquery.validate.min.js'>
</script>
<script>
$(document).ready(function(){
var frm = $("#surveyform")

frm.submit(function(e) {
  // e.preventDefault()
  const formData = new FormData(e.target);
  console.log(formData.get('surveydone'));
  if (formData.get('surveydone')=='YES') {
    var a = window.open('https://wp.me/P8g86e-Bs', "survey");
    a.focus();
  }
});
});
</script>
{% endblock %}

{% block main %}
<ul class="main-content">
  <li class="grid_4">
    <form enctype="multipart/form-data" method="post" id="surveyform">
      {% csrf_token %}
      <table>
        {{ form.as_table }}
      </table>
      <input type="submit" name="submit" value="CONTINUE">
  </li>

</ul>
{% endblock %}

{% block sidebar %}
{% include 'menu_profile.html' %}
{% endblock %}
