parent
6add9a10aa
commit
f19f501684
@ -34,16 +34,6 @@
|
||||
|
||||
<!-- Conditional logic for hiding and un-hiding fields. -->
|
||||
<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.
|
||||
// TODO: Move this knowledge out of the template
|
||||
var conditionalFields = [{
|
||||
@ -97,9 +87,6 @@
|
||||
"condition": ["N"]
|
||||
}];
|
||||
|
||||
|
||||
|
||||
|
||||
// Here we define the checkboxes that we need to use to
|
||||
// conditionally toggle fields - they use slightly different
|
||||
// logic as they rely on the 'checked' attribute rather than value.
|
||||
@ -165,7 +152,29 @@
|
||||
return array.indexOf(value) > -1;
|
||||
}
|
||||
|
||||
conditionalFields.forEach(addConditionalField);
|
||||
conditionalCheckboxes.forEach(addConditionalCheckbox);
|
||||
$(document).ready(function(){
|
||||
// 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>
|
||||
{% endblock %}
|
||||
|
Loading…
Reference in New Issue
Block a user