parent
6add9a10aa
commit
f19f501684
@ -34,16 +34,6 @@
|
|||||||
|
|
||||||
<!-- Conditional logic for hiding and un-hiding fields. -->
|
<!-- Conditional logic for hiding and un-hiding fields. -->
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
// Button classes for tab navigation
|
|
||||||
$('.btnNext').click(function(){
|
|
||||||
$('.nav-tabs > .active').next('li').find('a').trigger('click');
|
|
||||||
});
|
|
||||||
|
|
||||||
$('.btnPrevious').click(function(){
|
|
||||||
$('.nav-tabs > .active').prev('li').find('a').trigger('click');
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
// Here we define the fields we need to conditionally toggle.
|
// Here we define the fields we need to conditionally toggle.
|
||||||
// TODO: Move this knowledge out of the template
|
// TODO: Move this knowledge out of the template
|
||||||
var conditionalFields = [{
|
var conditionalFields = [{
|
||||||
@ -97,9 +87,6 @@
|
|||||||
"condition": ["N"]
|
"condition": ["N"]
|
||||||
}];
|
}];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Here we define the checkboxes that we need to use to
|
// Here we define the checkboxes that we need to use to
|
||||||
// conditionally toggle fields - they use slightly different
|
// conditionally toggle fields - they use slightly different
|
||||||
// logic as they rely on the 'checked' attribute rather than value.
|
// logic as they rely on the 'checked' attribute rather than value.
|
||||||
@ -165,7 +152,29 @@
|
|||||||
return array.indexOf(value) > -1;
|
return array.indexOf(value) > -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
conditionalFields.forEach(addConditionalField);
|
$(document).ready(function(){
|
||||||
conditionalCheckboxes.forEach(addConditionalCheckbox);
|
// Button classes for tab navigation
|
||||||
|
$('.btnNext').click(function(){
|
||||||
|
$('.nav-tabs > .active').next('li').find('a').trigger('click');
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.btnPrevious').click(function(){
|
||||||
|
$('.nav-tabs > .active').prev('li').find('a').trigger('click');
|
||||||
|
});
|
||||||
|
|
||||||
|
$('form').attr('novalidate', 'novalidate');
|
||||||
|
|
||||||
|
conditionalFields.forEach(addConditionalField);
|
||||||
|
conditionalCheckboxes.forEach(addConditionalCheckbox);
|
||||||
|
|
||||||
|
conditionalFields.forEach(function(item){
|
||||||
|
$(item.field).change();
|
||||||
|
});
|
||||||
|
|
||||||
|
conditionalCheckboxes.forEach(function(item){
|
||||||
|
$(item.checkbox).change();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
Loading…
Reference in New Issue
Block a user