From 5976ce9ea254b58ea03af02983e35b01c7389e82 Mon Sep 17 00:00:00 2001 From: Arona Jones Date: Thu, 8 Apr 2021 19:23:13 +0100 Subject: [PATCH] FIX Event form not displaying properly on creation error Turns out that bit of code was needed ya goof --- RIGS/templates/event_form.html | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/RIGS/templates/event_form.html b/RIGS/templates/event_form.html index c94244d7..87163ea5 100644 --- a/RIGS/templates/event_form.html +++ b/RIGS/templates/event_form.html @@ -34,8 +34,16 @@ {% endif %} //Creation {% else %} - //Initial hide - $('.form-hws').slideUp(dur); + // If there were errors, apply the previous Rig/not-Rig selection + {% if form.errors %} + $('.form-hws').show(); + if ($('#{{form.is_rig.auto_id}}').attr('checked') !== 'checked') { + $('.form-is_rig').hide(); + } + {% else %} + //Initial hide + $('.form-hws').slideUp(dur); + {% endif %} //Button handling $('#is_rig-selector button').on('click', function () { $('.form-non_rig').slideDown(dur); //Non rig stuff also needed for rig, so always slide down