Issue #19 won't be fixed, but documented.

Closes #19.
This commit is contained in:
Raphael Michel
2015-04-06 12:58:20 +02:00
parent 423f33ebf6
commit 150150b9b0
2 changed files with 17 additions and 28 deletions

View File

@@ -17,10 +17,27 @@
{% bootstrap_field form.type layout="horizontal" %}
{% bootstrap_field form.required layout="horizontal" %}
</fieldset>
<div class="alert alert-info alert-required-boolean">
{% blocktrans trimmed %}
If you mark a Yes/No question as required, it means that the user has to select Yes and No is not
accepted. If you want to allow both options, do not make this field required.
{% endblocktrans %}
</div>
<div class="form-group submit-group">
<button type="submit" class="btn btn-primary btn-save">
{% trans "Save" %}
</button>
</div>
</form>
<script type="text/javascript">
$(function() {
function alert_required_boolean() {
var show = $("#id_type").val() == "B" && $("#id_required").prop("checked");
$(".alert-required-boolean").toggle(show);
}
$("#id_type").change(alert_required_boolean);
$("#id_required").change(alert_required_boolean);
alert_required_boolean();
});
</script>
{% endblock %}