Private
Public Access
1
0

box chart now uses StatsOptionsForm

This commit is contained in:
Sander Roosendaal
2018-04-05 15:41:47 +02:00
parent d1c4255d40
commit d38e5cd813
2 changed files with 125 additions and 56 deletions

View File

@@ -18,7 +18,7 @@
$(function() {
// Get the form fields and hidden div
var modality = $("#id_modality");
var checkbox = $("#id_water");
var hidden = $("#id_waterboattype");
@@ -28,16 +28,14 @@
hidden.hide();
// Setup an event listener for when the state of the
// checkbox changes.
modality.change(function() {
checkbox.change(function() {
// Check to see if the checkbox is checked.
// If it is, show the fields and populate the input.
// If not, hide the fields.
var Value = modality.val();
if (Value=='water') {
// If not, hide the fields.
if (checkbox.is(':checked')) {
// Show the hidden fields.
hidden.show();
} else {
@@ -55,12 +53,7 @@
// $("#hidden_field").val("");
}
});
});
});
</script>
@@ -119,12 +112,12 @@
<div class="grid_4 alpha">
<table>
{{ modalityform.as_table }}
{{ optionsform.as_table }}
</table>
{% csrf_token %}
</div>
<div class="grid_2 omega">
<input name='modalityform' class="button green" type="submit" value="Submit">
<input name='optionsform' class="button green" type="submit" value="Submit">
</div>
</form>
</div>