|
@ -10,7 +10,7 @@ |
|
|
Vložit řešení |
|
|
Vložit řešení |
|
|
{% endblock %}{% endblock %} |
|
|
{% endblock %}{% endblock %} |
|
|
</h1> |
|
|
</h1> |
|
|
<form enctype="multipart/form-data" action="{% url 'seminar_nahraj_reseni' %}" method="post"> |
|
|
<form enctype="multipart/form-data" action="{% url 'seminar_nahraj_reseni' %}" method="post" onsubmit="return zkontroluj_prilohy();"> |
|
|
{% csrf_token %} |
|
|
{% csrf_token %} |
|
|
<table class='form' id="reseni"> |
|
|
<table class='form' id="reseni"> |
|
|
<tr> |
|
|
<tr> |
|
@ -106,4 +106,24 @@ |
|
|
<input type="submit" value="Odevzdat"> |
|
|
<input type="submit" value="Odevzdat"> |
|
|
</form> |
|
|
</form> |
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript"> |
|
|
|
|
|
function zkontroluj_prilohy() { |
|
|
|
|
|
var soucet = 0; |
|
|
|
|
|
var formulare = document.getElementById("form_set").children; |
|
|
|
|
|
for (var formular of formulare) { |
|
|
|
|
|
var upload = formular.getElementsByTagName("input")[0]; |
|
|
|
|
|
soucet += upload.files.length; |
|
|
|
|
|
} |
|
|
|
|
|
if (soucet == 0) { |
|
|
|
|
|
var vysledek = confirm("Nepřiložil jsi žádný soubor. Přesto odeslat?"); |
|
|
|
|
|
if (!vysledek) { |
|
|
|
|
|
event.preventDefault(); |
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
return true; |
|
|
|
|
|
} |
|
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{% endblock %} |
|
|
{% endblock %} |
|
|