javascript around race form
This commit is contained in:
@@ -26,7 +26,7 @@
|
|||||||
</p>
|
</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<p>
|
<p>
|
||||||
<table>
|
<table class="djangoform">
|
||||||
{{ form.as_table }}
|
{{ form.as_table }}
|
||||||
</table>
|
</table>
|
||||||
</p>
|
</p>
|
||||||
@@ -64,6 +64,41 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block scripts %}
|
{% block scripts %}
|
||||||
|
<script type='text/javascript'
|
||||||
|
src='https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js'>
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
$( document ).ready(function() {
|
||||||
|
|
||||||
|
$('#id_registration_form').change(function(){
|
||||||
|
|
||||||
|
var value = $(this).val();
|
||||||
|
|
||||||
|
if (value == 'windowstart') {
|
||||||
|
|
||||||
|
$('#id_registration_closure_0').val($('#id_startdate').val());
|
||||||
|
|
||||||
|
$('#id_registration_closure_1').val($('#id_start_time').val());
|
||||||
|
|
||||||
|
} else if (value == 'windowend') {
|
||||||
|
|
||||||
|
$('#id_registration_closure_0').val($('#id_enddate').val());
|
||||||
|
|
||||||
|
$('#id_registration_closure_1').val($('#id_end_time').val());
|
||||||
|
|
||||||
|
} else if (value == 'deadline') {
|
||||||
|
|
||||||
|
$('#id_registration_closure_0').val($('#id_evaluation_closure_0').val());
|
||||||
|
|
||||||
|
$('#id_registration_closure_1').val($('#id_evaluation_closure_1').val());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block sidebar %}
|
{% block sidebar %}
|
||||||
|
|||||||
@@ -56,6 +56,41 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block scripts %}
|
{% block scripts %}
|
||||||
|
<script type='text/javascript'
|
||||||
|
src='https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js'>
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
$( document ).ready(function() {
|
||||||
|
|
||||||
|
$('#id_registration_form').change(function(){
|
||||||
|
|
||||||
|
var value = $(this).val();
|
||||||
|
|
||||||
|
if (value == 'windowstart') {
|
||||||
|
|
||||||
|
$('#id_registration_closure_0').val($('#id_startdate').val());
|
||||||
|
|
||||||
|
$('#id_registration_closure_1').val($('#id_start_time').val());
|
||||||
|
|
||||||
|
} else if (value == 'windowend') {
|
||||||
|
|
||||||
|
$('#id_registration_closure_0').val($('#id_enddate').val());
|
||||||
|
|
||||||
|
$('#id_registration_closure_1').val($('#id_end_time').val());
|
||||||
|
|
||||||
|
} else if (value == 'deadline') {
|
||||||
|
|
||||||
|
$('#id_registration_closure_0').val($('#id_evaluation_closure_0').val());
|
||||||
|
|
||||||
|
$('#id_registration_closure_1').val($('#id_evaluation_closure_1').val());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block sidebar %}
|
{% block sidebar %}
|
||||||
|
|||||||
@@ -1086,3 +1086,7 @@ a.wh:hover {
|
|||||||
background: silver;
|
background: silver;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
table.djangoform tbody > tr > th {
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user