symposion_app/pinaxcon/templates/registrasion/profile_form.html
James Polley 348e1c5c82 Javascript hack to make it more clear that postcode is mandatory
On the two pages that display the profile form, add some javascript to
flag the postcode as required whenever the Country is AU
2017-10-01 18:45:29 +11:00

42 lines
1.2 KiB
HTML

{% extends "registrasion/base.html" %}
{% load lca2018_tags %}
{% block header_title %}Your profile{% endblock %}
{% block header_paragraph %}
These details will appear on your badge, your invoices, and will be used
to order catered food at the conference.
{% endblock %}
{% block scripts_extra %}
{{ form.media.js }}
<script type="text/javascript">
postcode_label = $("label[for='id_profile-state']");
postcode_help = $("#id_profile-state + p");
$('#id_profile-country').change(function () {
if ($(this).val() == 'AU' ) {
postcode_label.addClass('label-required');
postcode_help.show();
} else {
postcode_label.removeClass('label-required');
postcode_help.hide();
} });
$("#id_profile-country").change();
</script>
{% endblock %}
{% block content %}
THIS IS THE FORM
<form class="form-horizontal" method="post" action="">
{% csrf_token %}
<fieldset>
{% include "_form_snippet.html" with form=form %}
<br />
<div class="btn-group">
<input class="btn" type="submit" value="Save Profile" />
<a class="btn btn-primary" href="{% url "dashboard" %}">Return to dashboard</a>
</div>
</fieldset>
</form>
{% endblock %}