348e1c5c82
On the two pages that display the profile form, add some javascript to flag the postcode as required whenever the Country is AU
63 lines
1.7 KiB
HTML
63 lines
1.7 KiB
HTML
{% extends "registrasion/base.html" %}
|
|
{% load lca2018_tags %}
|
|
|
|
{% block header_title %}Buy Your Ticket{% endblock %}
|
|
{% block header_paragraph %}Step {{ current_step }} of {{ total_steps|add:1 }} – {{ title }} {% endblock %}
|
|
|
|
{% block scripts_extra %}
|
|
{% for section in sections %}
|
|
{{ section.form.media.js }}
|
|
{% endfor %}
|
|
<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 %}
|
|
|
|
<form class="form-horizontal" method="post" action="">
|
|
{% csrf_token %}
|
|
|
|
{% for section in sections %}
|
|
<h2>{{ section.title }}</h2>
|
|
|
|
{% if section.description %}
|
|
<blockquote>{{ section.description|safe }}</blockquote>
|
|
{% endif %}
|
|
|
|
<fieldset>
|
|
|
|
{% if section.discounts %}
|
|
{% include "registrasion/discount_list.html" with discounts=section.discounts %}
|
|
{% endif %}
|
|
|
|
<h3>Available options</h3>
|
|
|
|
{% include "_form_snippet.html" with form=section.form %}
|
|
</fieldset>
|
|
|
|
<br />
|
|
{% endfor %}
|
|
|
|
<div class="btn-group">
|
|
{% if current_step > 1 %}
|
|
<a class="btn btn-primary" role="button" href="{{ previous_step }}">Back</a>
|
|
{% endif %}
|
|
<input class="btn btn-success" type="submit" value="Next Step" />
|
|
</div>
|
|
</form>
|
|
|
|
|
|
{% endblock %}
|