Private
Public Access
1
0

javascript in documentsform

This commit is contained in:
Sander Roosendaal
2018-06-07 21:22:29 +02:00
parent a329b8b94e
commit e08456360d

View File

@@ -78,6 +78,28 @@
{% block scripts %}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script>
$( document ).ready(function() {
$('#id_workouttype').on('change', function(){
if (
$(this).val() == 'rower'
|| $(this).val() == 'skierg'
|| $(this).val() == 'dynamic'
|| $(this).val() == 'sliders'
|| $(this).val() == 'paddle'
|| $(this).val() == 'snow'
) {
$('#id_boattype').toggle(false);
$('#id_boattype').val('1x');
} else {
$('#id_boattype').toggle(true);
}
});
$('#id_workouttype').change();
});
</script>
<script>
var td = new FormData();
var formdatasetok = false;
@@ -97,7 +119,7 @@
if (formdatasetok) {
$(document).ready(function() {
$(document).ready(function() {
var csrftoken = jQuery("[name=csrfmiddlewaretoken]").val();
console.log("CSRF token",csrftoken);